When State Religion spread in, the food production will not add automatically, this is the main problem.Hmm that's puzzling. The most likely cause for a 2 food discrepancy is some sort of error with the Paganism civic. The bonus food from that may have been removed twice for some reason. Could you try adopting and dropping the Paganism civic a few times and see what that does? Likewise, switching between having a state religion and no state religion?
Hmm that's puzzling. The most likely cause for a 2 food discrepancy is some sort of error with the Paganism civic. The bonus food from that may have been removed twice for some reason. Could you try adopting and dropping the Paganism civic a few times and see what that does? Likewise, switching between having a state religion and no state religion?
def onReligionSpread(self, argsList):
'Religion Has Spread to a City'
iReligion, iOwner, pSpreadCity = argsList
# BUG-FIX: Extra Yield from State Religion
pPlayer = gc.getPlayer(iOwner)
iStateReligion = pPlayer.getStateReligion()
if iStateReligion == iReligion:
for iYieldType in range(3):
iCivic = HR.getStateReligionYieldCivic(iYieldType)
if pPlayer.isCivic(iCivic):
iYieldChange = HR.getStateReligionYieldCivicChange(iYieldType)
pSpreadCity.changeBaseYieldRate(iYieldType, iYieldChange)
# end of BUG-FIX
player = PyPlayer(iOwner)
if (not self.__LOG_RELIGIONSPREAD):
return
CvUtil.pyPrint('%s has spread to Player %d Civilization %s city of %s'
%(gc.getReligionInfo(iReligion).getDescription(), iOwner, player.getCivilizationName(), pSpreadCity.getName()))
def onReligionRemove(self, argsList):
'Religion Has been removed from a City'
iReligion, iOwner, pRemoveCity = argsList
# BUG-FIX: Extra Yield from State Religion
pPlayer = gc.getPlayer(iOwner)
iStateReligion = pPlayer.getStateReligion()
if iStateReligion == iReligion:
for iYieldType in range(3):
iCivic = HR.getStateReligionYieldCivic(iYieldType)
if pPlayer.isCivic(iCivic):
iYieldChange = HR.getStateReligionYieldCivicChange(iYieldType)
pRemoveCity.changeBaseYieldRate(iYieldType, iYieldChange * -1)
# end of BUG-FIX
player = PyPlayer(iOwner)
if (not self.__LOG_RELIGIONSPREAD):
return
CvUtil.pyPrint('%s has been removed from Player %d Civilization %s city of %s'
%(gc.getReligionInfo(iReligion).getDescription(), iOwner, player.getCivilizationName(), pRemoveCity.getName()))
<BuildingHappinessChange>
<BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType>
<iHappinessChange>1</iHappinessChange>
</BuildingHappinessChange>
We couldn't find the code for adding food when state religion spread to a new city -- we think this is what caused the bug to occur.
This is how we fixed it: in file CvEventManager.py, replace function onReligionSpread() and onReligionRemove() with the following code:
The fix for BUILDINGCLASS_PALACE_RECIPROCITY is to add :
to \Assets\XML\GameInfo\CIV4CivicInfos.xml entry CIVICOPTION_GOVERNMENTCode:<BuildingHappinessChange> <BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType> <iHappinessChange>1</iHappinessChange> </BuildingHappinessChange>
(provided by myclan)
That code will indeed fix the problem. Looks like I'd addressed this already in my test version but neglected to copy it to the 1.19 release version.
Yep. I've fixed this for 1.20 already![]()
for iCity in range(pPlayer.getNumCities()):
pCity = pPlayer.getCity(iCity)
The fix for BUILDINGCLASS_PALACE_RECIPROCITY is to add :
to \Assets\XML\GameInfo\CIV4CivicInfos.xml entry CIVICOPTION_GOVERNMENTCode:<BuildingHappinessChange> <BuildingType>BUILDINGCLASS_PALACE_RECIPROCITY</BuildingType> <iHappinessChange>1</iHappinessChange> </BuildingHappinessChange>
(provided by myclan)
Rather than setting this, why not simply set building class of "Modified Palace" to be Palace as well.
No need to have two different building class.