I think this is down to TB's chnages in rev 3524.
@TB:
In CvCity.cpp you made several chnages analogous to this one:
Code:
void CvCity::changeFreePromotionCount(PromotionTypes eIndex, int iChange)
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()");
m_paiFreePromotionCount[eIndex] = [B]std::min(0, (m_paiFreePromotionCount[eIndex] + iChange))[/B];
FAssert(getFreePromotionCount(eIndex) >= 0);
}
You did this for several modifiers. I suspect you meant to use 'max' not 'min', but either way it would be better done on the read as you did when you reworked it on the following rev:
Code:
int CvCity::getFreePromotionCount(PromotionTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()");
//TB Debug
//Somehow we are getting under 0 values here and that could cause problems down the road
//This method enforces minimum of 0 without changing the actual value of m_paiFreePromotionCount[eIndex](particularly puzzling) as the integrity of that value should be maintained.
int iValue = 0;
if (m_paiFreePromotionCount[eIndex] < 0)
{
iValue = 0;
}
else
{
iValue = m_paiFreePromotionCount[eIndex];
}
return iValue;
}
Again, you did this for several modifers, and for MOST you reverted the incorrect change from 3524, but not for (at least) promotions. The set-side std::min code needs to be reverted in all cases and the get-side code used (I think you put the get-side stuff in uniformly, but just didn't remove the broken set-side stuff in all cases)