Kael
Deity
Im not that sure what fassert is for, and google is not only not helping, but I believe its mocking me (the 3rd and 4th hit on a search on "fassert" and "c++" are both my threads, but im the one who doesnt know what it is!).
Anyway, the following is the SDK for the doGold function that runs on every player at the begining of his turn.
My question is, does the bolded line mean that an AI player (except the barbs) that has enough negative income to drop him below 0 is ignored?
Anyway, the following is the SDK for the doGold function that runs on every player at the begining of his turn.
My question is, does the bolded line mean that an AI player (except the barbs) that has enough negative income to drop him below 0 is ignored?
Code:
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();
[b] FAssert(isHuman() || isBarbarian() || ((getGold() + iGoldChange) >= 0));[/b]
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);
}
}