Minor Annoyance
Deity
I was trying to edit this part of the global warming code:
to have it check for a recycling center and only count it's BuildingBadHealth if it didn't have it. I tried to reverse engineer the code from other places and although it did successfully compile so I know it wasn't gibberish I was writing but nothing worked. Eventually I tried something that had to return as false:
but it still a mathematical impossibility doesn't stop it. So obviously there's something I'm doing wrong. Is there something about this context where an if statement doesn't work?
Also, assuming there's is a right way to even have a condition where I want it, what's the right way to check for a building in this context?
Code:
for (int iPlayer = 0; iPlayer < MAX_PLAYERS; ++iPlayer)
{
CvPlayer& kPlayer = GET_PLAYER((PlayerTypes) iPlayer);
if (kPlayer.isAlive())
{
int iLoop;
for (CvCity* pCity = kPlayer.firstCity(&iLoop); pCity != NULL; pCity = kPlayer.nextCity(&iLoop))
{
iGlobalWarmingValue -= pCity->getBuildingBadHealth() * iUnhealthWeight;
}
}
}
Code:
for (CvCity* pCity = kPlayer.firstCity(&iLoop); pCity != NULL; pCity = kPlayer.nextCity(&iLoop))
{
if (1 == 0);
{
iGlobalWarmingValue -= pCity->getBuildingBadHealth() * iUnhealthWeight;
}
}
Also, assuming there's is a right way to even have a condition where I want it, what's the right way to check for a building in this context?