NKA: fix accessing removed hero and heroExchangeCount

This commit is contained in:
Andrii Danylchenko
2023-07-31 22:01:11 +03:00
parent db2be3ee05
commit 5083100d3b
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -125,6 +125,7 @@ void HeroManager::update()
}
std::sort(myHeroes.begin(), myHeroes.end(), scoreSort);
heroRoles.clear();
for(auto hero : myHeroes)
{
+1
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()