Skip to content

Commit

Permalink
Check if attacker is not None before calling sorties.
Browse files Browse the repository at this point in the history
There is a rare occurence in the logs where a bullet/shell EventHit happens,
but no attacker is present. Perhaps a plane shot then disconnected before
the hits registered?
  • Loading branch information
FGlazov committed Nov 4, 2021
1 parent 32b10e0 commit cf7ca05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ Version 2.3.0

Version 2.3.1

- Update to 1.2.57 of IL2 Stats.
- Update to 1.2.57 of IL2 Stats.

Version 2.3.2

- Module Ammo breakdown: Fix rare bug where stats parser would crash if there was a hit registered in the DServer logs with a bullet/shell projectile that did not have an attacker.
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Authors: =FEW=Revolves and Enigma89

This is a mod for IL2 Stats, which adds and changes minor things to the IL2 stats websites. The mod is seperated into modules, which can be turned on and off so you can customize which of the features of the mod you wish to use. Descriptions of the modules follow.

This version of the mod is compatible with version 1.2.57 of IL2 stats.
This version of the mod is compatible with version 1.2.58 of IL2 stats.

------------ Modules which show new information ------------

Expand Down
8 changes: 5 additions & 3 deletions src/mod_rating_by_type/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ def record_hits(tik, target, attacker, ammo):
if attacker and attacker.coal_id == target.coal_id:
return

sortie = attacker.sortie
if attacker.parent:
sortie = attacker.parent.sortie
sortie = None
if attacker is not None:
sortie = attacker.sortie
if attacker.parent:
sortie = attacker.parent.sortie

if sortie:
if not hasattr(sortie, 'ammo_breakdown'):
Expand Down

0 comments on commit cf7ca05

Please sign in to comment.