فهرست منبع

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())
 	if(targets.unreachableEnemies.empty())
 		return result;
 		return result;
 
 
+	auto speed = activeStack->Speed();
+
+	if(speed == 0)
+		return result;
+
 	updateReachabilityMap(hb);
 	updateReachabilityMap(hb);
 
 
 	auto dists = cb->getReachability(activeStack);
 	auto dists = cb->getReachability(activeStack);
-	auto speed = activeStack->Speed();
 
 
 	for(const battle::Unit * enemy : targets.unreachableEnemies)
 	for(const battle::Unit * enemy : targets.unreachableEnemies)
 	{
 	{