Thanks for the heads up re: iShrineCount EF. Although it's painfully obvious now, I hadn't realized the using A += A + B means "A equals A + A + B". I've changed the code to use ++iShrineCount.

Not strictly speaking wrong though. I only need to know plurality, so the difference between 1 and 2 is the same as the difference between 1 and 511...

Still, I did it the wrong way, and I can easily imagine that not knowing the difference between += and ++ would
seriously mess me up in the future, so thank-you!
I've fixed the freezing bug. I'm not quite sure
why what I did fixed the freezing bug, but it doesn't happen anymore...
I noticed, while running through the debug DLL with
lots of breakpoints, that for some reason the code wasn't incrementing past Religion4 when done with Yield2. It would cycle back to Yield0, but still be stuck on Religion4... It seemed to me while watching it (as if I have any
real idea of what's happening...

) that there was some cross-talk going on between the functions. I've used alot of FOR statements, and they all use
iI as their variable. I realized I'd been treating
iI like is was some sort of sacred text, and it occurred to me that it's just a convention of the programmers that they always used
iI in FOR counters. So I mixed up the variable names a bit. Let me know what you think:
Code:
int CvCity::getGlobalReligionYield(YieldTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES");
return m_aiGlobalReligionYield[eIndex];
}
int CvCity::getGlobalReligionYieldByReligion(YieldTypes eIndex, ReligionTypes eReligion) const
{
int iYield;
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES");
FAssertMsg(eReligion >= 0, "eReligion expected to be >= 0");
FAssertMsg(eReligion < GC.getNumReligionInfos(), "GC.getNumReligionInfos expected to be >= 0");
iYield = 0;
if (isHasReligion(eReligion))
{
for (int [B]lL [/B]= 0; [B]lL [/B]< GC.getNumBuildingInfos(); [B]lL[/B]++)
{
if (GC.getBuildingInfo((BuildingTypes)[B]lL[/B]).getGlobalReligionYields() == eReligion)
{
if (getNumActiveBuilding((BuildingTypes)[B]lL[/B]) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)[B]lL[/B]) * GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}
}
}
return iYield;
}
void CvCity::updateGlobalReligionYield(YieldTypes eIndex)
{
int iOldYield = getGlobalReligionYield(eIndex);
int iNewYield = 0;
for (int [B]kK [/B]= 0; [B]kK [/B]< GC.getNumReligionInfos(); [B]kK[/B]++)
{
iNewYield += getGlobalReligionYieldByReligion(eIndex, (ReligionTypes)[B]kK[/B]);
}
if (iOldYield != iNewYield)
{
m_aiGlobalReligionYield[eIndex] = iNewYield;
FAssert(getGlobalReligionYield(eIndex) >= 0);
changeBaseYieldRate(eIndex, (iNewYield - iOldYield));
}
}
void CvCity::updateGlobalReligionYield()
{
int [B]iI[/B];
for ([B]iI [/B]= 0; [B]iI [/B]< GC.getNumReligionInfos(); [B]iI[/B]++)
{
if (hasShrine((ReligionTypes)[B]iI[/B]))
{
for (int [B]jJ [/B]= 0; [B]jJ [/B]< NUM_YIELD_TYPES; [B]jJ[/B]++)
{
updateGlobalReligionYield((YieldTypes)[B]jJ[/B]);
}
}
}
}
Unfortunately, the EXIT button problem is proving more recalcitrant. It's not a bad compile; I did a complete clean one of both the Final_Release and the Debug, and in both, the error is still present. It's not a result of changes I made in CvMainInterface either, I removed that file and the error persisted. I'm going to start redacting changes to the widgets, and see where it starts working again... ugh...
