Allow flights to self-initialize.

This makes it possible to add new packages to a running sim.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
This commit is contained in:
Dan Albert
2023-01-04 12:49:23 -08:00
committed by Raffson
parent ea726bbf06
commit f11689f4cb
3 changed files with 36 additions and 26 deletions

View File

@@ -20,7 +20,8 @@ class Uninitialized(FlightState):
def on_game_tick(
self, events: GameUpdateEvents, time: datetime, duration: timedelta
) -> None:
raise RuntimeError("Attempted to simulate flight that is not fully initialized")
self.reinitialize(time)
self.flight.state.on_game_tick(events, time, duration)
@property
def is_waiting_for_start(self) -> bool: