Bazaar developer reference

CvDiplomacyAI::SetPlayerBrokenMilitaryPromise(PlayerTypes, bool)

Defined in
CvDiplomacyAI.cpp, line 22373
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetPlayerBrokenMilitaryPromise

Hooks

static bool BeforeCvDiplomacyAI_SetPlayerBrokenMilitaryPromise(CvDiplomacyAI* self, PlayerTypes ePlayer, bool bValue);static void AfterCvDiplomacyAI_SetPlayerBrokenMilitaryPromise(CvDiplomacyAI* self, PlayerTypes ePlayer, bool bValue);static void ReplaceCvDiplomacyAI_SetPlayerBrokenMilitaryPromise(void (*original)(CvDiplomacyAI*, PlayerTypes, bool), CvDiplomacyAI* self, PlayerTypes ePlayer, bool bValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetPlayerBrokenMilitaryPromise>(host, &BeforeCvDiplomacyAI_SetPlayerBrokenMilitaryPromise);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetPlayerBrokenMilitaryPromise>(host, &AfterCvDiplomacyAI_SetPlayerBrokenMilitaryPromise);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetPlayerBrokenMilitaryPromise>(host, &ReplaceCvDiplomacyAI_SetPlayerBrokenMilitaryPromise);

Code

22373void CvDiplomacyAI::SetPlayerBrokenMilitaryPromise(PlayerTypes ePlayer, bool bValue)22374{22375	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");22376	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.");22377	m_pabPlayerBrokenMilitaryPromise[ePlayer] = bValue;2237822379	if(bValue)22380	{22381		GET_TEAM(GET_PLAYER(ePlayer).getTeam()).SetBrokenMilitaryPromise(true);22382	}22383}

Calls

Called by