1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-21 12:06:49 +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); std::sort(myHeroes.begin(), myHeroes.end(), scoreSort);
heroRoles.clear();
for(auto hero : myHeroes) for(auto hero : myHeroes)
{ {

View File

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