From 07108ce03da683597d86bd0036d83dbf654a9b2b Mon Sep 17 00:00:00 2001 From: Xilmi Date: Thu, 25 Jul 2024 21:49:17 +0200 Subject: [PATCH] Update PriorityEvaluator.cpp Allow defending in priority 2. --- AI/Nullkiller/Engine/PriorityEvaluator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AI/Nullkiller/Engine/PriorityEvaluator.cpp b/AI/Nullkiller/Engine/PriorityEvaluator.cpp index 5c91eca81..8389282c4 100644 --- a/AI/Nullkiller/Engine/PriorityEvaluator.cpp +++ b/AI/Nullkiller/Engine/PriorityEvaluator.cpp @@ -1408,6 +1408,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier) } case 2: //Collect guarded stuff { + if (evaluationContext.enemyHeroDangerRatio > 0.5 && !evaluationContext.isDefend) + return 0; if (evaluationContext.buildingCost.marketValue() > 0) return 0; score += evaluationContext.strategicalValue * 1000; @@ -1430,6 +1432,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier) } case 3: //For buildings and buying army { + if (maxWillingToLose - evaluationContext.armyLossPersentage < 0) + return 0; score += evaluationContext.conquestValue * 1000; score += evaluationContext.strategicalValue * 1000; score += evaluationContext.goldReward;