浏览代码

Fixed an issue that could cause the AI to skip almost their entire turn

If the best Task is to recruit a hero this now triggers pathfinding again as the newly bought hero may impair other heroe's paths.
Xilmi 10 月之前
父节点
当前提交
eab6de4686
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      AI/Nullkiller/Engine/Nullkiller.cpp

+ 6 - 1
AI/Nullkiller/Engine/Nullkiller.cpp

@@ -397,7 +397,12 @@ void Nullkiller::makeTurn()
 				if(!executeTask(bestTask))
 					return;
 
-				updateAiState(i, true);
+				bool fastUpdate = true;
+
+				if (bestTask->getHero() != nullptr)
+					fastUpdate = false;
+
+				updateAiState(i, fastUpdate);
 			}
 			else
 			{