Bladeren bron

Update PriorityEvaluator.cpp

Fixed losing heroes while exploring.
Xilmi 1 jaar geleden
bovenliggende
commit
60084243af
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  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)