Bazaar developer reference

CvDiplomacyAI::SetWantPeaceCounter(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 5506
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetWantPeaceCounter

Hooks

static bool BeforeCvDiplomacyAI_SetWantPeaceCounter(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void AfterCvDiplomacyAI_SetWantPeaceCounter(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void ReplaceCvDiplomacyAI_SetWantPeaceCounter(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetWantPeaceCounter>(host, &BeforeCvDiplomacyAI_SetWantPeaceCounter);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetWantPeaceCounter>(host, &AfterCvDiplomacyAI_SetWantPeaceCounter);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetWantPeaceCounter>(host, &ReplaceCvDiplomacyAI_SetWantPeaceCounter);

Code

5505/// Sets how long we've had our current War Goal with ePlayer5506void CvDiplomacyAI::SetWantPeaceCounter(PlayerTypes ePlayer, int iValue)5507{5508	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");5509	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");5510	CvAssertMsg(iValue >= 0, "DIPLOMACY_AI: Setting WantPeaceCounter to a negative value.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");55115512	m_paeWantPeaceCounter[ePlayer] = iValue;5513}

Called by