1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Fix possible crash on re-recruiting hero that transferred in campaign

This commit is contained in:
Ivan Savenko
2025-07-01 17:49:25 +03:00
parent 1daf9d3a44
commit 24ad703f86

View File

@@ -389,6 +389,7 @@ void CGameStateCampaign::replaceHeroesPlaceholders()
heroToPlace->setAnchorPos(heroPlaceholder->anchorPos());
heroToPlace->setHeroType(heroToPlace->getHeroTypeID());
heroToPlace->appearance = heroToPlace->getObjectHandler()->getTemplates().front();
heroToPlace->instanceName = heroPlaceholder->instanceName;
gameState->map->replaceObject(campaignHeroReplacement.heroPlaceholderId, heroToPlace);
}