Bazaar developer reference

CvCityReligions::AdoptReligionFully(ReligionTypes)

Defined in
CvReligionClasses.cpp, line 4214
Class
CvCityReligions
Hook name
CivHooks::CvCityReligions_AdoptReligionFully

Hooks

static bool BeforeCvCityReligions_AdoptReligionFully(CvCityReligions* self, ReligionTypes eReligion);static void AfterCvCityReligions_AdoptReligionFully(CvCityReligions* self, ReligionTypes eReligion);static void ReplaceCvCityReligions_AdoptReligionFully(void (*original)(CvCityReligions*, ReligionTypes), CvCityReligions* self, ReligionTypes eReligion);CivRegisterBefore<CivHooks::CvCityReligions_AdoptReligionFully>(host, &BeforeCvCityReligions_AdoptReligionFully);CivRegisterAfter<CivHooks::CvCityReligions_AdoptReligionFully>(host, &AfterCvCityReligions_AdoptReligionFully);CivRegisterReplace<CivHooks::CvCityReligions_AdoptReligionFully>(host, &ReplaceCvCityReligions_AdoptReligionFully);

Code

4213/// Set this city to have all citizens following a religion (mainly for scripting)4214void CvCityReligions::AdoptReligionFully(ReligionTypes eReligion)4215{4216	m_ReligionStatus.clear();42174218	CvReligionInCity religion;42194220	// Add 1 pop of Atheism (needed in case other religions wiped out by an Inquisitor/Prophet4221	religion.m_bFoundedHere = false;4222	religion.m_eReligion = NO_RELIGION;4223	religion.m_iFollowers = 1;4224#if defined(MOD_GLOBAL_RELIGIOUS_SETTLERS) || defined(MOD_RELIGION_LOCAL_RELIGIONS)4225	// This needs to be less than the pressure in a city with a pop of 14226	religion.m_iPressure = religion.m_iFollowers * GC.getRELIGION_ATHEISM_PRESSURE_PER_POP() - 1;4227#else4228	religion.m_iPressure = religion.m_iFollowers * GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();4229#endif4230	m_ReligionStatus.push_back(religion);42314232	// Now add full pop of this religion4233	religion.m_bFoundedHere = false;4234	religion.m_eReligion = eReligion;4235	religion.m_iFollowers = m_pCity->getPopulation();4236	religion.m_iPressure = religion.m_iFollowers * GC.getRELIGION_ATHEISM_PRESSURE_PER_POP();4237	m_ReligionStatus.push_back(religion);42384239#if defined(MOD_GLOBAL_RELIGIOUS_SETTLERS)4240	if (MOD_GLOBAL_RELIGIOUS_SETTLERS) {4241		RecomputeFollowers(FOLLOWER_CHANGE_ADOPT_FULLY, NO_RELIGION);4242	}4243#endif42444245	m_pCity->UpdateReligion(eReligion);4246}

Calls

Called by