浏览代码

Fixed one case when heroes exchanged armies until ran out of movement points.

DjWarmonger 10 年之前
父节点
当前提交
2f588b548e
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      AI/VCAI/VCAI.cpp

+ 7 - 7
AI/VCAI/VCAI.cpp

@@ -326,15 +326,15 @@ void VCAI::heroExchangeStarted(ObjectInstanceID hero1, ObjectInstanceID hero2, Q
 			pickBestCreatures (secondHero, firstHero);
 		else //regular criteria
 		{
-			if (firstHero->getFightingStrength() > secondHero->getFightingStrength() && canGetArmy (firstHero, secondHero))
-				pickBestCreatures (firstHero, secondHero);
-			else if (canGetArmy (secondHero, firstHero))
-				pickBestCreatures (secondHero, firstHero);
+			if (firstHero->getFightingStrength() > secondHero->getFightingStrength() && canGetArmy(firstHero, secondHero))
+				pickBestCreatures(firstHero, secondHero);
+			else if (canGetArmy(secondHero, firstHero))
+				pickBestCreatures(secondHero, firstHero);
+		}
 
-			completeGoal(sptr(Goals::VisitHero(firstHero->id.getNum()))); //TODO: what if we were visited by other hero in the meantime?
-			completeGoal(sptr(Goals::VisitHero(secondHero->id.getNum())));
+		completeGoal(sptr(Goals::VisitHero(firstHero->id.getNum()))); //TODO: what if we were visited by other hero in the meantime?
+		completeGoal(sptr(Goals::VisitHero(secondHero->id.getNum())));
 		//TODO: exchange artifacts
-		}
 
 		answerQuery(query, 0);
 	});