瀏覽代碼

BattleAI: fix camera obscura

Andrii Danylchenko 2 年之前
父節點
當前提交
59c3962e9c
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      AI/BattleAI/BattleExchangeVariant.cpp

+ 5 - 1
AI/BattleAI/BattleExchangeVariant.cpp

@@ -204,10 +204,14 @@ MoveTarget BattleExchangeEvaluator::findMoveTowardsUnreachable(const battle::Uni
 	if(targets.unreachableEnemies.empty())
 		return result;
 
+	auto speed = activeStack->Speed();
+
+	if(speed == 0)
+		return result;
+
 	updateReachabilityMap(hb);
 
 	auto dists = cb->getReachability(activeStack);
-	auto speed = activeStack->Speed();
 
 	for(const battle::Unit * enemy : targets.unreachableEnemies)
 	{