Переглянути джерело

Update PriorityEvaluator.cpp

Fixed affordabilitycheck not being negated.
Xilmi 1 рік тому
батько
коміт
e43492d8b5
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 1 - 1
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1490,7 +1490,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 					auto resourcesAvailable = evaluationContext.evaluator.ai->getFreeResources();
 					auto income = ai->buildAnalyzer->getDailyIncome();
 					score /= evaluationContext.buildingCost.marketValue();
-					if (resourcesAvailable.canAfford(evaluationContext.buildingCost))
+					if (!resourcesAvailable.canAfford(evaluationContext.buildingCost))
 					{
 						TResources needed = evaluationContext.buildingCost - resourcesAvailable;
 						needed.positive();