Bazaar developer reference

CvMinorCivAI::GetNumDisplayedQuestsForPlayer(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 5114
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetNumDisplayedQuestsForPlayer

Hooks

static bool BeforeCvMinorCivAI_GetNumDisplayedQuestsForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetNumDisplayedQuestsForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetNumDisplayedQuestsForPlayer(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetNumDisplayedQuestsForPlayer>(host, &BeforeCvMinorCivAI_GetNumDisplayedQuestsForPlayer);CivRegisterAfter<CivHooks::CvMinorCivAI_GetNumDisplayedQuestsForPlayer>(host, &AfterCvMinorCivAI_GetNumDisplayedQuestsForPlayer);CivRegisterReplace<CivHooks::CvMinorCivAI_GetNumDisplayedQuestsForPlayer>(host, &ReplaceCvMinorCivAI_GetNumDisplayedQuestsForPlayer);

Code

5114int CvMinorCivAI::GetNumDisplayedQuestsForPlayer(PlayerTypes ePlayer)5115{5116	CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");5117	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");5118	if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0;51195120	int iValue = 0;5121	5122	for (uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++)5123	{5124		if(!m_QuestsGiven[ePlayer][iQuestLoop].IsHandled())5125		{5126			iValue++;5127		}5128	}51295130	return iValue;5131}

Calls

Called by