God-Emperor
Deity
Yet another CvAI bug:
In doCityAIProduction, on line 425 (in the section on calculating the weights for the military type weight) it is trying to add the system's production (quadrupled) but is using pCity.getProduction(). Sadly, this is, according to the API docs as linked to at the Modiki, not the city's total production but rather the amount of production points it has spent on the thing it is currently building. But the thing is, I think, only calling this function when it is trying to figure out what to put into an empty build queue, so I would expect .getProdution to return 0.
Oops.
Has:
Should have:
if it should include all modifiers like factories and such, if not it should be pCity.getBaseYieldRate. I think it should be the entire modified total, so I did the above fix.
In doCityAIProduction, on line 425 (in the section on calculating the weights for the military type weight) it is trying to add the system's production (quadrupled) but is using pCity.getProduction(). Sadly, this is, according to the API docs as linked to at the Modiki, not the city's total production but rather the amount of production points it has spent on the thing it is currently building. But the thing is, I think, only calling this function when it is trying to figure out what to put into an empty build queue, so I would expect .getProdution to return 0.
Oops.
Has:
Code:
aiWeights[iMilitaryWeightType] += (pCity.getProduction() * 4)
Code:
aiWeights[iMilitaryWeightType] += (pCity.getYieldRate(YieldTypes.YIELD_PRODUCTION) * 4)