From af2df5763f29ad12dc13fe57ef74b875ac01cdcd Mon Sep 17 00:00:00 2001 From: Xilmi Date: Thu, 12 Sep 2024 22:53:45 +0200 Subject: [PATCH] Update PriorityEvaluator.cpp Only if there is a high gold-pressure a buildings' cost will deter from its score. --- AI/Nullkiller/Engine/PriorityEvaluator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AI/Nullkiller/Engine/PriorityEvaluator.cpp b/AI/Nullkiller/Engine/PriorityEvaluator.cpp index 295428a06..b6ee0b112 100644 --- a/AI/Nullkiller/Engine/PriorityEvaluator.cpp +++ b/AI/Nullkiller/Engine/PriorityEvaluator.cpp @@ -1441,7 +1441,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier) score += 1000; auto resourcesAvailable = evaluationContext.evaluator.ai->getFreeResources(); auto income = ai->buildAnalyzer->getDailyIncome(); - score /= evaluationContext.buildingCost.marketValue(); + if(ai->buildAnalyzer->isGoldPressureHigh()) + score /= evaluationContext.buildingCost.marketValue(); if (!resourcesAvailable.canAfford(evaluationContext.buildingCost)) { TResources needed = evaluationContext.buildingCost - resourcesAvailable;