Fix date given to the conditions generator.

`Game.date` is actually the start date, not the current date. Not renaming to
avoid breaking save compat.

This fix won't have any effect on existing saves until they pass the turn
because this is encoded into the conditions generated at the start of the turn,
but it will fix on the next turn.

Fixes https://github.com/Khopa/dcs_liberation/issues/973
This commit is contained in:
Dan Albert 2021-04-10 15:18:33 -07:00
parent 828c87df39
commit ab746b5195

View File

@ -96,6 +96,7 @@ class Game:
self.enemy_name = enemy_name
self.enemy_country = db.FACTIONS[enemy_name].country
self.turn = 0
# NB: This is the *start* date. It is never updated.
self.date = date(start_date.year, start_date.month, start_date.day)
self.game_stats = GameStats()
self.game_stats.update(self)
@ -152,7 +153,7 @@ class Game:
def generate_conditions(self) -> Conditions:
return Conditions.generate(
self.theater, self.date, self.current_turn_time_of_day, self.settings
self.theater, self.current_day, self.current_turn_time_of_day, self.settings
)
def sanitize_sides(self):