1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix crash on removing town with garrisoned hero from map

This commit is contained in:
Ivan Savenko
2025-07-01 13:34:15 +03:00
parent 2d00d8a585
commit 8fcbc09b8e

View File

@@ -420,8 +420,8 @@ void GameStatePackVisitor::visitRemoveObject(RemoveObject & pack)
if (town->getGarrisonHero())
{
town->setGarrisonedHero(nullptr);
gs.getMap().showObject(gs.getHero(town->getGarrisonHero()->id));
town->setGarrisonedHero(nullptr);
}
}