Bazaar developer reference

CvDiplomacyAI::GetHasAdoptedHisReligionScore(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 23467
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetHasAdoptedHisReligionScore

Hooks

static bool BeforeCvDiplomacyAI_GetHasAdoptedHisReligionScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetHasAdoptedHisReligionScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetHasAdoptedHisReligionScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetHasAdoptedHisReligionScore>(host, &BeforeCvDiplomacyAI_GetHasAdoptedHisReligionScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetHasAdoptedHisReligionScore>(host, &AfterCvDiplomacyAI_GetHasAdoptedHisReligionScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetHasAdoptedHisReligionScore>(host, &ReplaceCvDiplomacyAI_GetHasAdoptedHisReligionScore);

Code

23467int CvDiplomacyAI::GetHasAdoptedHisReligionScore(PlayerTypes ePlayer)23468{23469	int iOpinionWeight = 0;23470	if(m_pPlayer->GetReligions()->HasOthersReligionInMostCities(ePlayer))23471	{23472		iOpinionWeight += /*-5*/ GC.getOPINION_WEIGHT_ADOPTING_HIS_RELIGION() * GC.getEraInfo(GC.getGame().getCurrentEra())->getDiploEmphasisReligion();23473	}23474	return iOpinionWeight;23475}

Calls

Called by