Fix "no-purchase" bug at turn 0

This commit is contained in:
Raffson 2023-09-17 12:25:21 +02:00
parent 3787ec3039
commit 1b000e83df
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 8 additions and 4 deletions

View File

@ -179,7 +179,7 @@ class Coalition:
with logged_duration("Transport planning"): with logged_duration("Transport planning"):
self.transfers.plan_transports() self.transfers.plan_transports()
if not is_turn_0 or not self.game.settings.enable_squadron_aircraft_limits: if not is_turn_0:
self.plan_missions() self.plan_missions()
self.plan_procurement() self.plan_procurement()

View File

@ -326,7 +326,9 @@ class Game:
# TODO: Check for overfull bases. # TODO: Check for overfull bases.
# We don't need to actually stream events for turn zero because we haven't given # We don't need to actually stream events for turn zero because we haven't given
# *any* state to the UI yet, so it will need to do a full draw once we do. # *any* state to the UI yet, so it will need to do a full draw once we do.
self.initialize_turn(GameUpdateEvents()) self.initialize_turn(
GameUpdateEvents(), squadrons_start_full=squadrons_start_full
)
def pass_turn(self, no_action: bool = False) -> None: def pass_turn(self, no_action: bool = False) -> None:
"""Ends the current turn and initializes the new turn. """Ends the current turn and initializes the new turn.
@ -372,6 +374,7 @@ class Game:
events: GameUpdateEvents, events: GameUpdateEvents,
for_red: bool = True, for_red: bool = True,
for_blue: bool = True, for_blue: bool = True,
squadrons_start_full: bool = False,
) -> None: ) -> None:
"""Performs turn initialization for the specified players. """Performs turn initialization for the specified players.
@ -406,6 +409,7 @@ class Game:
events: Game update event container for turn initialization. events: Game update event container for turn initialization.
for_red: True if opfor should be re-initialized. for_red: True if opfor should be re-initialized.
for_blue: True if the player coalition should be re-initialized. for_blue: True if the player coalition should be re-initialized.
squadrons_start_full: True if generator setting was checked.
""" """
# Check for win or loss condition FIRST! # Check for win or loss condition FIRST!
turn_state = self.check_win_loss() turn_state = self.check_win_loss()
@ -424,9 +428,9 @@ class Game:
# Plan Coalition specific turn # Plan Coalition specific turn
if for_blue: if for_blue:
self.blue.initialize_turn(self.turn == 0) self.blue.initialize_turn(self.turn == 0 and squadrons_start_full)
if for_red: if for_red:
self.red.initialize_turn(self.turn == 0) self.red.initialize_turn(self.turn == 0 and squadrons_start_full)
# Plan GroundWar # Plan GroundWar
self.ground_planners = {} self.ground_planners = {}