Bazaar developer reference

CvGameReligions::IsPreferredByCivInGame(ReligionTypes)

Defined in
CvReligionClasses.cpp, line 2593
Class
CvGameReligions
Hook name
CivHooks::CvGameReligions_IsPreferredByCivInGame

Hooks

static bool BeforeCvGameReligions_IsPreferredByCivInGame(CvGameReligions* self, ReligionTypes eReligion, bool& result);static void AfterCvGameReligions_IsPreferredByCivInGame(CvGameReligions* self, ReligionTypes eReligion, bool& result);static bool ReplaceCvGameReligions_IsPreferredByCivInGame(bool (*original)(CvGameReligions*, ReligionTypes), CvGameReligions* self, ReligionTypes eReligion);CivRegisterBefore<CivHooks::CvGameReligions_IsPreferredByCivInGame>(host, &BeforeCvGameReligions_IsPreferredByCivInGame);CivRegisterAfter<CivHooks::CvGameReligions_IsPreferredByCivInGame>(host, &AfterCvGameReligions_IsPreferredByCivInGame);CivRegisterReplace<CivHooks::CvGameReligions_IsPreferredByCivInGame>(host, &ReplaceCvGameReligions_IsPreferredByCivInGame);

Code

2592/// Does any civ in the game like this religion?2593bool CvGameReligions::IsPreferredByCivInGame(ReligionTypes eReligion)2594{2595	PlayerTypes eLoopPlayer;25962597	for(int iI = 0; iI < MAX_MAJOR_CIVS; iI++)2598	{2599		eLoopPlayer = (PlayerTypes) iI;2600		CvPlayer& loopPlayer = GET_PLAYER(eLoopPlayer);26012602		if(!loopPlayer.isAlive())2603		{2604			continue;2605		}26062607		ReligionTypes eCivReligion = loopPlayer.getCivilizationInfo().GetReligion();2608		if(eCivReligion == eReligion)2609		{2610			return true;2611		}2612	}26132614	return false;2615}

Calls

Called by