Skip to content

Commit

Permalink
Properly increment ammo breakdown of turret attacker.
Browse files Browse the repository at this point in the history
  • Loading branch information
FGlazov committed Apr 9, 2021
1 parent c4bcc56 commit 3181fee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/mod_rating_by_type/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ def record_hits(target, attacker, ammo):
if attacker.cls == 'aircraft_turret' and attacker.parent:
ammo_breakdown[LAST_TURRET_ACCOUNT] = attacker.parent.sortie.account_id

if attacker and attacker.coal_id == target.coal_id:
return

sortie = attacker.sortie
if sortie is None and attacker.parent:
sortie = attacker.parent
if attacker.cls == 'aircraft_turret' and attacker.parent:
sortie = attacker.parent.sortie

if sortie is not None:
if sortie:
if not hasattr(sortie, 'ammo_breakdown'):
sortie.ammo_breakdown = default_ammo_breakdown()

Expand Down

0 comments on commit 3181fee

Please sign in to comment.