From 0f3913a56dc9a44d445a4ccf45c99bffe75d2788 Mon Sep 17 00:00:00 2001 From: Toffer Date: Sun, 13 Jun 2021 03:36:18 +0200 Subject: [PATCH] Semi-reverted change that caused CTD; the change wasn't bugged, it only revealed a bigger bug. --- Sources/CvPlayerAI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/CvPlayerAI.cpp b/Sources/CvPlayerAI.cpp index 0a769e6afc..359908222a 100644 --- a/Sources/CvPlayerAI.cpp +++ b/Sources/CvPlayerAI.cpp @@ -30839,9 +30839,10 @@ int CvPlayerAI::AI_promotionValue(PromotionTypes ePromotion, UnitTypes eUnit, co //end mod //@MOD Commanders: control points promotion AI value - if (pUnit != NULL) + iTemp = kPromotion.getControlPoints(); + if (iTemp != 0 && pUnit != NULL) { - iValue += kPromotion.getControlPoints() * (100 + 25 * pUnit->plot()->getNumUnits()); + iValue += iTemp * (100 + 25 * pUnit->plot()->getNumUnits()); } //end mod