Chazcon
Prince
Modding BtS - in CvPlayer.cpp I get this assert at some point in every game I'm playtesting while debugging. For the life of me I can't track down this damn bug. I haven't modded anything specifically to do with gold but you know how it is... as you can see I've commented it out so I can continue to test my mod stuff but at the end I'd like this bug to be resolved. Anyone else encounter this?
Code:
// Protected Functions...
void CvPlayer::doGold()
{
bool bStrike;
int iGoldChange;
int iDisbandUnit;
int iI;
CyArgsList argsList;
argsList.add(getID());
long lResult=0;
gDLL->getPythonIFace()->callFunction(PYGameModule, "doGold", argsList.makeFunctionArgs(), &lResult);
if (lResult == 1)
{
return;
}
iGoldChange = calculateGoldRate();
//FAssert(isHuman() || isBarbarian() || ((getGold() + iGoldChange) >= 0) || isAnarchy());// ChazModTEMP asserts here, bug not found
changeGold(iGoldChange);
bStrike = false;
if (getGold() < 0)
{
setGold(0);
if (!isBarbarian() && (getNumCities() > 0))
{
bStrike = true;
}
}
if (bStrike)
{
setStrike(true);
changeStrikeTurns(1);
if (getStrikeTurns() > 1)
{
iDisbandUnit = (getStrikeTurns() / 2); // XXX mod?
for (iI = 0; iI < iDisbandUnit; iI++)
{
disbandUnit(true);
if (calculateGoldRate() >= 0)
{
break;
}
}
}
}
else
{
setStrike(false);
}
}