Possible issue when an AI chooses the best promotion for his unit

Joined
Feb 6, 2006
Messages
796
BTS 3.17. I'm not sure if it's an issue of BTS, or if it's been introduced with the last patch.

In the SDK, class CvUnitAI, function AI_promotionValue.
It uses the iValue variable to store the total through the whole function, and the iTemp variable to partial results in each section.
However, when it considers FirstStrikes and ChanceFirstStrikes, it computes a value
Code:
		iTemp *= 8;
		iExtra = getExtraChanceFirstStrikes() + getExtraFirstStrikes() * 2;
		iTemp *= 100 + iExtra * 15;
		iTemp /= 100;

but the it DOESN'T add it to iValue, so this has NO EFFECT on the final decision.

It should be something like that:
Code:
		iTemp *= 8;
		iExtra = getExtraChanceFirstStrikes() + getExtraFirstStrikes() * 2;
		iTemp *= 100 + iExtra * 15;
		iTemp /= 100;
		iValue += iTemp;
 
Back
Top Bottom