Kaynağa Gözat

Update PriorityEvaluator.cpp

Fixed affordabilitycheck not being negated.
Xilmi 1 yıl önce
ebeveyn
işleme
e43492d8b5
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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();