1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

NKA: fix accessing removed hero and heroExchangeCount

This commit is contained in:
Andrii Danylchenko 2023-07-24 22:19:09 +03:00
parent db2be3ee05
commit 5083100d3b
2 changed files with 2 additions and 0 deletions

View File

@ -125,6 +125,7 @@ void HeroManager::update()
}
std::sort(myHeroes.begin(), myHeroes.end(), scoreSort);
heroRoles.clear();
for(auto hero : myHeroes)
{

View File

@ -134,6 +134,7 @@ void ChainActor::setBaseActor(HeroActor * base)
armyCost = base->armyCost;
actorAction = base->actorAction;
tiCache = base->tiCache;
actorExchangeCount = base->actorExchangeCount;
}
void HeroActor::setupSpecialActors()