CvPlayerAI::CanFoundOrEnhanceReligion()
- Defined in
- CvPlayerAI.cpp, line 421
- Class
- CvPlayerAI
- Hook name
CivHooks::CvPlayerAI_CanFoundOrEnhanceReligion
Hooks
static bool BeforeCvPlayerAI_CanFoundOrEnhanceReligion(CvPlayerAI* self, bool& result);static void AfterCvPlayerAI_CanFoundOrEnhanceReligion(CvPlayerAI* self, bool& result);static bool ReplaceCvPlayerAI_CanFoundOrEnhanceReligion(bool (*original)(CvPlayerAI*), CvPlayerAI* self);CivRegisterBefore<CivHooks::CvPlayerAI_CanFoundOrEnhanceReligion>(host, &BeforeCvPlayerAI_CanFoundOrEnhanceReligion);CivRegisterAfter<CivHooks::CvPlayerAI_CanFoundOrEnhanceReligion>(host, &AfterCvPlayerAI_CanFoundOrEnhanceReligion);CivRegisterReplace<CivHooks::CvPlayerAI_CanFoundOrEnhanceReligion>(host, &ReplaceCvPlayerAI_CanFoundOrEnhanceReligion);
Code
420#if defined(MOD_AI_GREAT_PEOPLE_CHOICES)421bool CvPlayerAI::CanFoundOrEnhanceReligion()422{423 CvGameReligions *pReligions = GC.getGame().GetGameReligions();424 ReligionTypes eMyReligion = pReligions->GetReligionCreatedByPlayer(GetID());425 426 if(eMyReligion <= RELIGION_PANTHEON)427 {428 // I've not got a religion, can I still get one?429 return pReligions->GetNumReligionsStillToFound() > 0;430 }431 432 // I've got a religion, do I need to enhance it433 const CvReligion* pMyReligion = pReligions->GetReligion(eMyReligion, GetID());434 return !pMyReligion->m_bEnhanced;435}