CvCityReligions::AddSpyPressure(ReligionTypes, int)
- Defined in
- CvReligionClasses.cpp, line 4187
- Class
- CvCityReligions
- Hook name
CivHooks::CvCityReligions_AddSpyPressure
Hooks
static bool BeforeCvCityReligions_AddSpyPressure(CvCityReligions* self, ReligionTypes eReligion, int iBasePressure);static void AfterCvCityReligions_AddSpyPressure(CvCityReligions* self, ReligionTypes eReligion, int iBasePressure);static void ReplaceCvCityReligions_AddSpyPressure(void (*original)(CvCityReligions*, ReligionTypes, int), CvCityReligions* self, ReligionTypes eReligion, int iBasePressure);CivRegisterBefore<CivHooks::CvCityReligions_AddSpyPressure>(host, &BeforeCvCityReligions_AddSpyPressure);CivRegisterAfter<CivHooks::CvCityReligions_AddSpyPressure>(host, &AfterCvCityReligions_AddSpyPressure);CivRegisterReplace<CivHooks::CvCityReligions_AddSpyPressure>(host, &ReplaceCvCityReligions_AddSpyPressure);
Code
4186/// Add pressure to recruit followers to a religion4187void CvCityReligions::AddSpyPressure(ReligionTypes eReligion, int iBasePressure)4188{4189 bool bRecompute = false;4190 ReligionTypes eOldMajorityReligion = GetReligiousMajority();41914192 ReligionInCityList::iterator it;4193 for(it = m_ReligionStatus.begin(); it != m_ReligionStatus.end(); it++)4194 {4195 if(it->m_eReligion == eReligion)4196 {4197 int iPressure = GC.getGame().getGameSpeedInfo().getReligiousPressureAdjacentCity();4198 iPressure *= iBasePressure;4199 it->m_iPressure += iPressure;42004201 // Found it, so we're done4202 bRecompute = true;4203 }4204 }42054206 // Didn't find it, add new entry4207 if(bRecompute)4208 {4209 RecomputeFollowers(FOLLOWER_CHANGE_SPY_PRESSURE, eOldMajorityReligion);4210 }4211}