Bazaar developer reference

CvGameReligions::GetReligion(ReligionTypes, PlayerTypes) const

Defined in
CvReligionClasses.cpp, line 1654
Class
CvGameReligions
Hook name
CivHooks::CvGameReligions_GetReligion

Hooks

static bool BeforeCvGameReligions_GetReligion(const CvGameReligions* self, ReligionTypes eReligion, PlayerTypes ePlayer, const CvReligion*& result);static void AfterCvGameReligions_GetReligion(const CvGameReligions* self, ReligionTypes eReligion, PlayerTypes ePlayer, const CvReligion*& result);static const CvReligion* ReplaceCvGameReligions_GetReligion(const CvReligion* (*original)(const CvGameReligions*, ReligionTypes, PlayerTypes), const CvGameReligions* self, ReligionTypes eReligion, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvGameReligions_GetReligion>(host, &BeforeCvGameReligions_GetReligion);CivRegisterAfter<CivHooks::CvGameReligions_GetReligion>(host, &AfterCvGameReligions_GetReligion);CivRegisterReplace<CivHooks::CvGameReligions_GetReligion>(host, &ReplaceCvGameReligions_GetReligion);

Code

1653/// Return a pointer to a religion that has been founded1654const CvReligion* CvGameReligions::GetReligion(ReligionTypes eReligion, PlayerTypes ePlayer) const1655{1656	ReligionList::const_iterator it;1657	for(it = m_CurrentReligions.begin(); it != m_CurrentReligions.end(); it++)1658	{1659		// If talking about a pantheon, make sure to match the player1660		if(it->m_eReligion == eReligion && it->m_eReligion == RELIGION_PANTHEON)1661		{1662			if(it->m_eFounder == ePlayer)1663			{1664				return it;1665			}1666		}1667		else if(it->m_eReligion == eReligion)1668		{1669			return it;1670		}1671	}16721673	return NULL;1674}

Calls

Called by

87 functions in 18 files