CvCityReligions::DoPopulationChange(int)
- Defined in
- CvReligionClasses.cpp, line 3891
- Class
- CvCityReligions
- Hook name
CivHooks::CvCityReligions_DoPopulationChange
Hooks
static bool BeforeCvCityReligions_DoPopulationChange(CvCityReligions* self, int iChange);static void AfterCvCityReligions_DoPopulationChange(CvCityReligions* self, int iChange);static void ReplaceCvCityReligions_DoPopulationChange(void (*original)(CvCityReligions*, int), CvCityReligions* self, int iChange);CivRegisterBefore<CivHooks::CvCityReligions_DoPopulationChange>(host, &BeforeCvCityReligions_DoPopulationChange);CivRegisterAfter<CivHooks::CvCityReligions_DoPopulationChange>(host, &AfterCvCityReligions_DoPopulationChange);CivRegisterReplace<CivHooks::CvCityReligions_DoPopulationChange>(host, &ReplaceCvCityReligions_DoPopulationChange);
Code
3890/// Handle a change in the city population3891void CvCityReligions::DoPopulationChange(int iChange)3892{3893 ReligionTypes eMajorityReligion = GetReligiousMajority();38943895 // Only add pressure if the population went up; if starving, leave pressure alone (but recompute followers)3896 if(iChange > 0)3897 {3898 AddReligiousPressure(FOLLOWER_CHANGE_POP_CHANGE, eMajorityReligion, iChange * GC.getRELIGION_ATHEISM_PRESSURE_PER_POP());3899 }3900 else if (iChange < 0)3901 {3902 RecomputeFollowers(FOLLOWER_CHANGE_POP_CHANGE, eMajorityReligion);3903 }3904}