From 8a6b7b172cdbed004747b548d9153eda82610e92 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sat, 19 Aug 2023 15:13:44 +0200 Subject: [PATCH] Fix #199 Adjust 'should_halt_sim' conditions for taxi & takeoff flight-states, fixing an infinite loop that would occur if the FF-interrupt setting would not match with the start-type of the flight --- game/ato/flightstate/takeoff.py | 3 ++- game/ato/flightstate/taxi.py | 3 ++- game/settings/settings.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/game/ato/flightstate/takeoff.py b/game/ato/flightstate/takeoff.py index 119f0d99..8d99d540 100644 --- a/game/ato/flightstate/takeoff.py +++ b/game/ato/flightstate/takeoff.py @@ -45,7 +45,8 @@ class Takeoff(AtDeparture): def should_halt_sim(self) -> bool: if ( self.flight.client_count > 0 - and self.settings.player_mission_interrupts_sim_at is StartType.RUNWAY + and self.settings.player_mission_interrupts_sim_at + is [StartType.COLD, StartType.WARM, StartType.RUNWAY] ): logging.info( f"Interrupting simulation because {self.flight} has players and has " diff --git a/game/ato/flightstate/taxi.py b/game/ato/flightstate/taxi.py index 96f7a430..0ae35dbe 100644 --- a/game/ato/flightstate/taxi.py +++ b/game/ato/flightstate/taxi.py @@ -37,7 +37,8 @@ class Taxi(AtDeparture): def should_halt_sim(self) -> bool: if ( self.flight.client_count > 0 - and self.settings.player_mission_interrupts_sim_at is StartType.WARM + and self.settings.player_mission_interrupts_sim_at + in [StartType.COLD, StartType.WARM] ): logging.info( f"Interrupting simulation because {self.flight} has players and has " diff --git a/game/settings/settings.py b/game/settings/settings.py index 96f62156..9fead7b2 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -536,9 +536,8 @@ class Settings: "Player missions interrupt fast forward", page=MISSION_GENERATOR_PAGE, section=GAMEPLAY_SECTION, - default=None, + default=StartType.COLD, choices={ - "Never": None, "At startup time": StartType.COLD, "At taxi time": StartType.WARM, "At takeoff time": StartType.RUNWAY,