From 0c4d0965a6be91b4582a72363ae4c067d1827b0b Mon Sep 17 00:00:00 2001 From: WiseDev <83840010+wisedevik@users.noreply.github.com> Date: Sun, 23 Aug 2026 14:53:41 +0300 Subject: [PATCH] keep the two summoners in the opening state LogicBattle::resetSimulatedManaTimers reads both leaders out of the battle at +96 and +104 and calls a virtual on each without a null check, so an opening state with no leaders segfaults inside LogicGameMode ::decode before anything else happens. so the opening state carries the two king towers and nothing else. they are the objects that cannot get a model - the battle screen, and with it the listener, does not exist yet - and they are also the pair the hud caches at [SpellButton+0x1d0], so they are exactly the objects that must not be replaced later either. everything else, princess towers included, now arrives after the screen is up. --- crates/game-service/src/battle_session.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/game-service/src/battle_session.rs b/crates/game-service/src/battle_session.rs index 5929f94..f49b44b 100644 --- a/crates/game-service/src/battle_session.rs +++ b/crates/game-service/src/battle_session.rs @@ -60,8 +60,11 @@ impl BattleSession { } fn opening(&self) -> LogicGameMode { let mut mode = self.mode.clone(); - mode.battle.objects.objects.clear(); - mode.battle.leaders = Default::default(); + let leaders = mode.battle.leaders; + mode.battle + .objects + .objects + .retain(|entry| leaders.contains(&entry.global_id)); mode.battle.leader_towers = Default::default(); mode }