1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-17 20:58:07 +02:00

Fix crash

Reinstated 2 lines who's removal caused a crash at the end of a turn in which a hero is killed.
This commit is contained in:
Xilmi 2024-12-08 12:29:30 +01:00
parent af02664afe
commit 4ff7516a58

View File

@ -1197,7 +1197,9 @@ void RemoveObject::applyGs(CGameState *gs)
{
auto * beatenHero = dynamic_cast<CGHeroInstance *>(obj);
assert(beatenHero);
PlayerState* p = gs->getPlayerState(beatenHero->tempOwner);
gs->map->heroesOnMap -= beatenHero;
p->removeOwnedObject(beatenHero);
auto * siegeNode = beatenHero->whereShouldBeAttachedOnSiege(gs);