浏览代码

Update PriorityEvaluator.cpp

Fixed losing heroes while exploring.
Xilmi 1 年之前
父节点
当前提交
60084243af
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 4 - 0
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1429,6 +1429,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 					return 0;
 				if (evaluationContext.explorePriority != 1)
 					return 0;
+				if (maxWillingToLose - evaluationContext.armyLossPersentage < 0)
+					return 0;
 				score = 1000;
 				score *= evaluationContext.closestWayRatio;
 				if (evaluationContext.movementCost > 0)
@@ -1473,6 +1475,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 					return 0;
 				if (evaluationContext.explorePriority != 3)
 					return 0;
+				if (maxWillingToLose - evaluationContext.armyLossPersentage < 0)
+					return 0;
 				score = 1000;
 				score *= evaluationContext.closestWayRatio;
 				if (evaluationContext.movementCost > 0)