Bazaar developer reference

CvMinorCivAI::EndAllActiveQuestsForPlayer(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 5103
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_EndAllActiveQuestsForPlayer

Hooks

static bool BeforeCvMinorCivAI_EndAllActiveQuestsForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer);static void AfterCvMinorCivAI_EndAllActiveQuestsForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer);static void ReplaceCvMinorCivAI_EndAllActiveQuestsForPlayer(void (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_EndAllActiveQuestsForPlayer>(host, &BeforeCvMinorCivAI_EndAllActiveQuestsForPlayer);CivRegisterAfter<CivHooks::CvMinorCivAI_EndAllActiveQuestsForPlayer>(host, &AfterCvMinorCivAI_EndAllActiveQuestsForPlayer);CivRegisterReplace<CivHooks::CvMinorCivAI_EndAllActiveQuestsForPlayer>(host, &ReplaceCvMinorCivAI_EndAllActiveQuestsForPlayer);

Code

5102/// Get rid of all active quests5103void CvMinorCivAI::EndAllActiveQuestsForPlayer(PlayerTypes ePlayer)5104{5105	CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");5106	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");5107	if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return;51085109	//antonjs: todo: instead, call for cancel quest (with flag for no notif)5110	if(GetNumActiveQuestsForPlayer(ePlayer) > 0)5111		m_QuestsGiven[ePlayer].clear();5112}

Calls

Called by