Bazaar developer reference

CvDiplomacyAI::SetDemandTargetPlayer(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 4617
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetDemandTargetPlayer

Hooks

static bool BeforeCvDiplomacyAI_SetDemandTargetPlayer(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_SetDemandTargetPlayer(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_SetDemandTargetPlayer(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetDemandTargetPlayer>(host, &BeforeCvDiplomacyAI_SetDemandTargetPlayer);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetDemandTargetPlayer>(host, &AfterCvDiplomacyAI_SetDemandTargetPlayer);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetDemandTargetPlayer>(host, &ReplaceCvDiplomacyAI_SetDemandTargetPlayer);

Code

4616/// Sets a player we're targeting to make a demand from, backed with force4617void CvDiplomacyAI::SetDemandTargetPlayer(PlayerTypes ePlayer)4618{4619	CvAssertMsg(ePlayer >= NO_PLAYER, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");	// We could be targeting no one to make a demand (duh)4620	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");46214622	m_eDemandTargetPlayer = ePlayer;4623}

Called by