From db7cd17c10b5e798ebf7c40da4ffbb28fe8e4abb Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 15 Oct 2022 14:40:46 -0700 Subject: [PATCH] Send the new turn event from turn initialization. We'll have to get smarter about this some day (since turn initialization won't always exist), but for now we can avoid stale UI data by doing what we've always done and refreshing the world on turn init. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2397. --- game/game.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/game.py b/game/game.py index 32abab7e..d2054682 100644 --- a/game/game.py +++ b/game/game.py @@ -341,7 +341,6 @@ class Game: with logged_duration("Turn initialization"): self.initialize_turn(events) - events.begin_new_turn() EventStream.put_nowait(events) # Autosave progress @@ -436,6 +435,8 @@ class Game: with logged_duration("Computing culling positions"): self.compute_unculled_zones(events) + events.begin_new_turn() + def message(self, title: str, text: str = "") -> None: self.informations.append(Information(title, text, turn=self.turn))