Maybe, if you want to look over all the places where the result from calculateUnitCost and calculateUnitSupply is used then that would be great of course.
I looked a bit around myself, and saw in the cases I looked at that there are proper usage of the "isNPC() → simplify" for many AI economically related functions.
The change I showed in last post would make sure that the code always consider the NPC's as teams with absolutely no expenses at all internally. It will additionally reduce the amount of code processed for NPC teams each end turn.
There should be a function for calculateUnitSupply that may need a similar change.
Yeah, here it is:
int CvPlayer::calculateUnitSupply() const
{
int iPaidUnits;
int iBaseSupplyCost;
if (isAnarchy())
{
return 0;
}
//ls612: Gold Modifiers by Gamespeed
int iCost = calculateUnitSupply(iPaidUnits, iBaseSupplyCost) * (GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGoldModifier());
if (iCost != 0)
{
iCost /= 100;
}
return iCost;
}
▬▬▬▬▬▬
NEW ▬▬▬▬▬▬
int CvPlayer::calculateUnitSupply() const
{
if (isAnarchy() || isNPC())
{
return 0;
}
int iPaidUnits;
int iBaseSupplyCost;
int iCost = calculateUnitSupply(iPaidUnits, iBaseSupplyCost)
//ls612: Gold Modifiers by Gamespeed
if iCost
{
iCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGoldModifier() / 100;
}
return iCost
}