Bazaar developer reference

CvMinorCivAI::DoCompletedQuests()

Defined in
CvMinorCivAI.cpp, line 3869
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_DoCompletedQuests

Hooks

static bool BeforeCvMinorCivAI_DoCompletedQuests(CvMinorCivAI* self);static void AfterCvMinorCivAI_DoCompletedQuests(CvMinorCivAI* self);static void ReplaceCvMinorCivAI_DoCompletedQuests(void (*original)(CvMinorCivAI*), CvMinorCivAI* self);CivRegisterBefore<CivHooks::CvMinorCivAI_DoCompletedQuests>(host, &BeforeCvMinorCivAI_DoCompletedQuests);CivRegisterAfter<CivHooks::CvMinorCivAI_DoCompletedQuests>(host, &AfterCvMinorCivAI_DoCompletedQuests);CivRegisterReplace<CivHooks::CvMinorCivAI_DoCompletedQuests>(host, &ReplaceCvMinorCivAI_DoCompletedQuests);

Code

3868// Check for quests that have been completed, process them beginning with the player with highest resulting influence.3869void CvMinorCivAI::DoCompletedQuests()3870{3871	WeightedCivsList vePlayers = CalculateFriendshipFromQuests();38723873	// Resolve quests starting with player that will end up with most influence, to avoid multiple ally swaps and awkward war declarations3874	for (int iMajorIndex = 0; iMajorIndex < vePlayers.size(); iMajorIndex++)3875	{3876		PlayerTypes eMajor = vePlayers.GetElement(iMajorIndex);3877		DoCompletedQuestsForPlayer(eMajor);3878	}3879}

Calls

Called by