Skip to content

Commit

Permalink
Fix bug where tank score sortie penalties did not work prorperly.
Browse files Browse the repository at this point in the history
  • Loading branch information
FGlazov committed Oct 10, 2021
1 parent c290cfc commit 86df6bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,8 @@ Version 1.8.0

Version 1.8.1

- Update objects.csv
- Update objects.csv

Version 1.8.2

- Fix bug where tank penalties were not working properly.
2 changes: 0 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Tank mod version: 3.4
Stats Enhancements version : 2.3.0
Global Aircraft Stats mod version : 1.4.4

DISCLAIMER: This module is NOT (currently) retroactive, it will only split the stats of new sorties.

Installation
--------------------------------------------
1. You need an installation of il2 stats. The latest version can be found under https://forum.il2sturmovik.com/topic/19083-il2-stats-statistics-system-for-a-dedicated-server-il2-battle-of-stalingrad/
Expand Down
12 changes: 8 additions & 4 deletions src/mod_rating_by_type/stats_whore.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,17 @@ def update_bonus_score(new_sortie):
new_sortie.score = new_sortie.score_dict['basic']

if new_sortie.is_dead:
penalty_pct = bonuses_score_dict['mod_penalty_dead']['base']
penalty_key = 'mod_penalty_dead' if is_aircraft else 'tank_penalty_dead'
penalty_pct = bonuses_score_dict[penalty_key]['base']
elif new_sortie.is_captured:
penalty_pct = bonuses_score_dict['mod_penalty_captured']['base']
penalty_key = 'mod_penalty_captured' if is_aircraft else 'tank_penalty_captured'
penalty_pct = bonuses_score_dict[penalty_key]['base']
elif new_sortie.is_bailout:
penalty_pct = bonuses_score_dict['mod_penalty_bailout']['base']
penalty_key = 'mod_penalty_bailout' if is_aircraft else 'tank_penalty_bailout'
penalty_pct = bonuses_score_dict[penalty_key]['base']
elif new_sortie.is_shotdown:
penalty_pct = bonuses_score_dict['mod_penalty_shotdown']['base']
penalty_key = 'mod_penalty_shotdown' if is_aircraft else 'tank_penalty_shotdown'
penalty_pct = bonuses_score_dict[penalty_key]['base']
new_sortie.score = int(new_sortie.score * ((100 - penalty_pct) / 100))
new_sortie.score_dict['penalty_pct'] = penalty_pct

Expand Down

0 comments on commit 86df6bb

Please sign in to comment.