mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
BattleAI: missing lock
This commit is contained in:
parent
f9442208da
commit
07ae33b8f4
@ -68,7 +68,12 @@ void RecruitHero::accept(AIGateway * ai)
|
||||
throw cannotFulfillGoalException("Town " + t->nodeName() + " is occupied. Cannot recruit hero!");
|
||||
|
||||
cb->recruitHero(t, heroToHire);
|
||||
ai->nullkiller->heroManager->update();
|
||||
|
||||
{
|
||||
std::unique_lock lockGuard(ai->nullkiller->aiStateMutex);
|
||||
|
||||
ai->nullkiller->heroManager->update();
|
||||
}
|
||||
|
||||
if(t->visitingHero)
|
||||
ai->moveHeroToTile(t->visitablePos(), t->visitingHero.get());
|
||||
|
Loading…
Reference in New Issue
Block a user