mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
#1228 - prevent second AI activation on AI defeat due to wrong EndTurn packet
This commit is contained in:
@@ -74,6 +74,8 @@ Goals::TTask Nullkiller::choseBestTask(Goals::TTaskVec & tasks) const
|
||||
|
||||
Goals::TTask Nullkiller::choseBestTask(Goals::TSubgoal behavior, int decompositionMaxDepth) const
|
||||
{
|
||||
boost::this_thread::interruption_point();
|
||||
|
||||
logAi->debug("Checking behavior %s", behavior->toString());
|
||||
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
@@ -160,8 +162,12 @@ void Nullkiller::updateAiState(int pass, bool fast)
|
||||
cfg.mainTurnDistanceLimit = MAIN_TURN_DISTANCE_LIMIT * ((int)scanDepth + 1);
|
||||
}
|
||||
|
||||
boost::this_thread::interruption_point();
|
||||
|
||||
pathfinder->updatePaths(activeHeroes, cfg);
|
||||
|
||||
boost::this_thread::interruption_point();
|
||||
|
||||
objectClusterizer->clusterize();
|
||||
}
|
||||
|
||||
@@ -212,6 +218,8 @@ HeroLockedReason Nullkiller::getHeroLockedReason(const CGHeroInstance * hero) co
|
||||
|
||||
void Nullkiller::makeTurn()
|
||||
{
|
||||
boost::lock_guard<boost::mutex> sharedStorageLock(AISharedStorage::locker);
|
||||
|
||||
const int MAX_DEPTH = 10;
|
||||
|
||||
resetAiState();
|
||||
|
||||
Reference in New Issue
Block a user