EmperorFool
Deity
How are you checking to make sure the city has the shrine?
int CvCity::getGlobalReligionYieldByReligion(YieldTypes eIndex, ReligionTypes eReligion, BuildingTypes eBuilding) 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))
{
[B] if (GC.getBuildingInfo(eBuilding).getGlobalReligionYields() != NO_RELIGION)
[/B] {
iYield += 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 iI = 0; iI < GC.getNumReligionInfos(); iI++)
{[COLOR="Red"]// The below line is #8390[/COLOR]
iNewYield += getGlobalReligionYieldByReligion(eIndex, (ReligionTypes)iI);
}
if (iOldYield != iNewYield)
{
m_aiGlobalReligionYield[eIndex] = iNewYield;
FAssert(getGlobalReligionYield(eIndex) >= 0);
changeBaseYieldRate(eIndex, (iNewYield - iOldYield));
}
}
CvCity.cpp(8390) : error C2660: 'CvCity::getGlobalReligionYieldByReligion' : function does not take 2 arguments
if (isHasReligion(eReligion))
{
for (int iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{
if (GC.getBuildingInfo(iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)iI) * GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}
}
int CvCity::getGlobalReligionYieldByReligion(YieldTypes eIndex, ReligionTypes eReligion, BuildingTypes eBuilding) 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 iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{[COLOR="Red"]// the below line is #8329[/COLOR]
if (GC.getBuildingInfo(iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)iI) * 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 iI = 0; iI < GC.getNumReligionInfos(); iI++)
{[COLOR="Red"]// the below line is #8401[/COLOR]
iNewYield += getGlobalReligionYieldByReligion(eIndex, (ReligionTypes)iI);
}
if (iOldYield != iNewYield)
{
m_aiGlobalReligionYield[eIndex] = iNewYield;
FAssert(getGlobalReligionYield(eIndex) >= 0);
changeBaseYieldRate(eIndex, (iNewYield - iOldYield));
}
}
CvCity.cpp(8329) : error C2664: 'CvBuildingInfo &CvGlobals::getBuildingInfo(BuildingTypes)' : cannot convert parameter 1 from 'int' to 'BuildingTypes'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
CvCity.cpp(8329) : error C2228: left of '.getGlobalReligionYields' must have class/struct/union type
CvCity.cpp(8401) : error C2660: 'CvCity::getGlobalReligionYieldByReligion' : function does not take 2 arguments
bool CvCity::getGlobalReligionYieldbyShrine(BuildingTypes eBuilding) const
{
bool bHasShrine;
for (int iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{
if GC.getBuildingInfo(iI).getGlobalReligionYields() != NO_RELIGION
{
if getNumActiveBuilding((BuildingTypes)iI) > 0)
{
bHasShrine = true;
}
}
return bHasShrine;
}
}
GC.getBuildingInfo([B][COLOR="Red"](BuildingTypes)[/COLOR][/B]iI)
int CvCity::getGlobalReligionYieldByReligion(YieldTypes eIndex, ReligionTypes eReligion[B][COLOR="Red"][s], BuildingTypes eBuilding[/s][/COLOR][/B]) const
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");
if (isHasReligion(eReligion))
{[COLOR="Red"]// The below lone is #8326[/COLOR]
for (int iI = 0; iI < GC.getNumBuildingInfos(BuildingTypes); iI++)
{[COLOR="Red"]// The below lone is #8328[/COLOR]
if (GC.getBuildingInfo(iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}}
return iYield;
}
Thanks...CvCity.cpp(8326) : error C2275: 'BuildingTypes' : illegal use of this type as an expression
c:\Documents and Settings\Richard Langlois\Desktop\Civ IV Mods\CvGameCoreDLL\CvEnums.h(1098) : see declaration of 'BuildingTypes'
CvCity.cpp(8328) : error C2664: 'CvBuildingInfo &CvGlobals::getBuildingInfo(BuildingTypes)' : cannot convert parameter 1 from 'int' to 'BuildingTypes'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
CvCity.cpp(8328) : error C2228: left of '.getGlobalReligionYields' must have class/struct/union type
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 iI = 0; iI < GC.getNumBuildingInfos(BuildingTypes); iI++)
{
if (GC.getBuildingInfo(iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)iI) * GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}
}
return iYield;
}
CvCity.cpp(8326) : error C2275: 'BuildingTypes' : illegal use of this type as an expression
c:\Documents and Settings\Richard Langlois\Desktop\Civ IV Mods\CvGameCoreDLL\CvEnums.h(1098) : see declaration of 'BuildingTypes'
CvCity.cpp(8328) : error C2664: 'CvBuildingInfo &CvGlobals::getBuildingInfo(BuildingTypes)' : cannot convert parameter 1 from 'int' to 'BuildingTypes'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
CvCity.cpp(8328) : error C2228: left of '.getGlobalReligionYields' must have class/struct/union type
if (GC.getBuildingInfo([B][COLOR="Red"](BuildingTypes)[/COLOR][/B]iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
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 iI = 0; iI < GC.getNumBuildingInfos(BuildingTypes); iI++)
{
if (GC.getBuildingInfo((BuildingTypes)iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)iI) * GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}
}
return iYield;
}
At least it's a different error. That's progress, right?CvCity.cpp(8328) : error C2275: 'BuildingTypes' : illegal use of this type as an expression
for (int iI = 0; iI < GC.getNumBuildingInfos(); iI++)
Ugh... Success so close I can taste it, but C++ hates me...![]()
if (GC.getBuildingInfo((BuildingTypes)iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
[COLOR="Red"][B]*[/B][/COLOR]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];
}
[COLOR="Red"][B]*[/B][/COLOR]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;
[COLOR="Red"][B]*[/B][/COLOR] if (isHasReligion(eReligion))
{
[COLOR="Red"][B]*[/B][/COLOR] for (int iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{
[COLOR="Red"][B]*[/B][/COLOR] if (GC.getBuildingInfo((BuildingTypes)iI).getGlobalReligionYields() != NO_RELIGION && getNumActiveBuilding((BuildingTypes)iI) > 0)
{
iYield += getNumActiveBuilding((BuildingTypes)iI) * GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex) * GC.getGameINLINE().countReligionLevels(eReligion);
}
}
}
[COLOR="Red"][B]*[/B][/COLOR] return iYield;
}
[COLOR="Red"][B]*[/B][/COLOR]void CvCity::updateGlobalReligionYield(YieldTypes eIndex)
{
int iOldYield = getGlobalReligionYield(eIndex);
int iNewYield = 0;
for (int iI = 0; iI < GC.getNumReligionInfos(); iI++)
{
iNewYield += getGlobalReligionYieldByReligion(eIndex, (ReligionTypes)iI);
}
if (iOldYield != iNewYield)
{
m_aiGlobalReligionYield[eIndex] = iNewYield;
FAssert(getGlobalReligionYield(eIndex) >= 0);
changeBaseYieldRate(eIndex, (iNewYield - iOldYield));
}
}
void CvCity::updateGlobalReligionYield()
[COLOR="Red"][B]*[/B][/COLOR]{
int iI;
for (iI = 0; iI < NUM_YIELD_TYPES; iI++)
{
updateGlobalReligionYield((YieldTypes)iI);
}
}