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