Skip to content

Commit

Permalink
Recognize more bombs/rockets.
Browse files Browse the repository at this point in the history
  • Loading branch information
FGlazov committed Jul 7, 2021
1 parent 7e22be5 commit cb7ac35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ Version 2.2.0

Version 2.2.1

- Fix bug where damaged sortie logs without attached hits were causing a 500 error in pilot sortie logs.
- Fix bug where damaged sortie logs without attached hits were causing a 500 error in pilot sortie logs.

Version 2.2.2

- Fix bug where not all sorties with bombs/rockets as fighter were being recognized as attackers. For example FW 190 A8 with side bombs only, or Hurricanes with bombs.
12 changes: 11 additions & 1 deletion src/mod_rating_by_type/variant_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

FIGHTER_WHITE_LIST = {'P-38J-25', 'Me 262 A'}
JABO_MODS = {'Ground attack modification', 'U17 strike modification'}
BOMBS_ROCKETS = ['FAB-100M', 'FAB-250tsk', 'GP ', 'MC ', 'SC ', 'SD ', '21cm WGr.42', 'lb Cooper', 'H.E.R.L.',
'Pz.Bl. 1', 'R-Sprgr. M8', 'P.u.W', 'ROS-82', 'RBS-82', 'ROFS-132', '50-T', '100-T', 'M64', 'M65',
'M8', 'FAB-250sv', 'FAB-500M', 'RP-3']


# The P-38 and Me-262 are considered as fighters for this function.
# (They're technically aircraft_medium, i.e. attackers)
def is_jabo(sortie):
return True in [__is_modification_jabo(mod) for mod in sortie.modifications]
return [__is_modification_jabo(mod) for mod in sortie.modifications] or __payload_has_bomb(sortie.payload)


def __is_modification_jabo(mod):
Expand All @@ -19,6 +22,13 @@ def __is_modification_jabo(mod):
return False


def __payload_has_bomb(payload):
for bomb_rocket in BOMBS_ROCKETS:
if bomb_rocket in str(payload):
return True
return False


def decide_adjusted_cls(sortie, touch_db=False, retroactive_compute=False):
"""
Every sortie needs a class for split rankings to work, i.e. is this a fighter, attacker, or bomber sortie. This
Expand Down

0 comments on commit cb7ac35

Please sign in to comment.