Bazaar developer reference

CvDiplomacyAI::ChangeIgnoredExpansionPromiseValue(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 7866
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_ChangeIgnoredExpansionPromiseValue

Hooks

static bool BeforeCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void AfterCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void ReplaceCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);CivRegisterBefore<CivHooks::CvDiplomacyAI_ChangeIgnoredExpansionPromiseValue>(host, &BeforeCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue);CivRegisterAfter<CivHooks::CvDiplomacyAI_ChangeIgnoredExpansionPromiseValue>(host, &AfterCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue);CivRegisterReplace<CivHooks::CvDiplomacyAI_ChangeIgnoredExpansionPromiseValue>(host, &ReplaceCvDiplomacyAI_ChangeIgnoredExpansionPromiseValue);

Code

7865// Changing the value of the expansion ignored promise7866void CvDiplomacyAI::ChangeIgnoredExpansionPromiseValue(PlayerTypes ePlayer, int iChange)7867{7868	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send slewis this with your last 5 autosaves and what changelist # you're playing.");7869	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send slewis this with your last 5 autosaves and what changelist # you're playing.");7870	if (iChange != 0)7871	{7872		m_paiIgnoredExpansionPromiseValue[(int)ePlayer] += iChange;7873		if (m_paiIgnoredExpansionPromiseValue[(int)ePlayer] < 0)7874		{7875			m_paiIgnoredExpansionPromiseValue[(int)ePlayer] = 0;7876		}7877	}7878}

Called by