Bazaar developer reference

CvCityReligions::GetSecondaryReligionPantheonBelief()

Defined in
CvReligionClasses.cpp, line 3688
Class
CvCityReligions
Hook name
CivHooks::CvCityReligions_GetSecondaryReligionPantheonBelief

Hooks

static bool BeforeCvCityReligions_GetSecondaryReligionPantheonBelief(CvCityReligions* self, BeliefTypes& result);static void AfterCvCityReligions_GetSecondaryReligionPantheonBelief(CvCityReligions* self, BeliefTypes& result);static BeliefTypes ReplaceCvCityReligions_GetSecondaryReligionPantheonBelief(BeliefTypes (*original)(CvCityReligions*), CvCityReligions* self);CivRegisterBefore<CivHooks::CvCityReligions_GetSecondaryReligionPantheonBelief>(host, &BeforeCvCityReligions_GetSecondaryReligionPantheonBelief);CivRegisterAfter<CivHooks::CvCityReligions_GetSecondaryReligionPantheonBelief>(host, &AfterCvCityReligions_GetSecondaryReligionPantheonBelief);CivRegisterReplace<CivHooks::CvCityReligions_GetSecondaryReligionPantheonBelief>(host, &ReplaceCvCityReligions_GetSecondaryReligionPantheonBelief);

Code

3687/// Is there a pantheon belief in the secondary religion here?3688BeliefTypes CvCityReligions::GetSecondaryReligionPantheonBelief()3689{3690	BeliefTypes eRtnValue = NO_BELIEF;36913692	// Check for the policy that allows a secondary religion to be active3693	if (GET_PLAYER(m_pCity->getOwner()).IsSecondReligionPantheon())3694	{3695		ReligionTypes eSecondary = GetSecondaryReligion();3696		if (eSecondary != NO_RELIGION)3697		{3698			const CvReligion* pReligion = GC.getGame().GetGameReligions()->GetReligion(eSecondary, m_pCity->getOwner());3699			if(pReligion)3700			{3701				for(int iI = 0; iI < pReligion->m_Beliefs.GetNumBeliefs(); iI++)3702				{3703					const BeliefTypes eBelief = pReligion->m_Beliefs.GetBelief(iI);3704					CvBeliefEntry* pEntry = GC.GetGameBeliefs()->GetEntry((int)eBelief);3705					if(pEntry && pEntry->IsPantheonBelief())3706					{3707						eRtnValue = eBelief;3708						break;3709					}3710				}3711			}3712		}3713	}37143715	return eRtnValue;3716}

Calls

Called by