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.
This commit is contained in:
parent
cb5b04f3ca
commit
0c4d0965a6
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue