Bazaar developer reference

CvPlayer::ChangeNumFaithGreatPeople(int)

Defined in
CvPlayer.cpp, line 27629
Class
CvPlayer
Hook name
CivHooks::CvPlayer_ChangeNumFaithGreatPeople

Hooks

static bool BeforeCvPlayer_ChangeNumFaithGreatPeople(CvPlayer* self, int iChange);static void AfterCvPlayer_ChangeNumFaithGreatPeople(CvPlayer* self, int iChange);static void ReplaceCvPlayer_ChangeNumFaithGreatPeople(void (*original)(CvPlayer*, int), CvPlayer* self, int iChange);CivRegisterBefore<CivHooks::CvPlayer_ChangeNumFaithGreatPeople>(host, &BeforeCvPlayer_ChangeNumFaithGreatPeople);CivRegisterAfter<CivHooks::CvPlayer_ChangeNumFaithGreatPeople>(host, &AfterCvPlayer_ChangeNumFaithGreatPeople);CivRegisterReplace<CivHooks::CvPlayer_ChangeNumFaithGreatPeople>(host, &ReplaceCvPlayer_ChangeNumFaithGreatPeople);

Code

27629void CvPlayer::ChangeNumFaithGreatPeople(int iChange)27630{27631	m_iNumFaithGreatPeople = GetNumFaithGreatPeople() + iChange;27632	if(iChange > 0)27633	{27634		if(isHuman())27635		{27636			CvNotifications* pNotifications = GetNotifications();27637			if(pNotifications)27638			{27639				CvString strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_FAITH_GREAT_PERSON");27640				CvString strSummary = GetLocalizedText("TXT_KEY_NOTIFICATION_FAITH_GREAT_PERSON_TT");27641				pNotifications->Add(NOTIFICATION_FAITH_GREAT_PERSON, strSummary.c_str(), strBuffer.c_str(), -1, -1, -1);27642			}27643		}27644		else27645		{27646			for(int iI = 0; iI < iChange; iI++)27647			{27648				AI_chooseFreeGreatPerson();27649			}27650		}27651	}27652}

Calls

Called by