Bazaar developer reference

CvDiplomacyAI::ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 10148
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor

Hooks

static bool BeforeCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void AfterCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void ReplaceCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);CivRegisterBefore<CivHooks::CvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor>(host, &BeforeCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor);CivRegisterAfter<CivHooks::CvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor>(host, &AfterCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor);CivRegisterReplace<CivHooks::CvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor>(host, &ReplaceCvDiplomacyAI_ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor);

Code

10148void CvDiplomacyAI::ChangeOtherPlayerTurnsSinceSidedWithProtectedMinor(PlayerTypes ePlayer, int iChange)10149{10150	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10151	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10152	if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return;1015310154	SetOtherPlayerTurnsSinceSidedWithProtectedMinor(ePlayer, GetTurnsSinceOtherPlayerSidedWithProtectedMinor(ePlayer) + iChange);10155}

Calls

Called by