浏览代码

Merge pull request #1595 from vcmi/vkai-hack-to-workaround-freezes

VCAI: hard limit on iterations per turn
Ivan Savenko 2 年之前
父节点
当前提交
06b35ce533
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      AI/VCAI/VCAI.cpp

+ 1 - 1
AI/VCAI/VCAI.cpp

@@ -863,7 +863,7 @@ void VCAI::mainLoop()
 
 
 	invalidPathHeroes.clear();
 	invalidPathHeroes.clear();
 
 
-	while (basicGoals.size())
+	for (int pass = 0; pass< 30 && basicGoals.size(); pass++)
 	{
 	{
 		vstd::removeDuplicates(basicGoals); //TODO: container which does this automagically without has would be nice
 		vstd::removeDuplicates(basicGoals); //TODO: container which does this automagically without has would be nice
 		goalsToAdd.clear();
 		goalsToAdd.clear();