Bazaar developer reference

CvDiplomacyAI::GetTurnsSinceOtherPlayerSidedWithProtectedMinor(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 10130
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor

Hooks

static bool BeforeCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor>(host, &BeforeCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor>(host, &AfterCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor>(host, &ReplaceCvDiplomacyAI_GetTurnsSinceOtherPlayerSidedWithProtectedMinor);

Code

10130int CvDiplomacyAI::GetTurnsSinceOtherPlayerSidedWithProtectedMinor(PlayerTypes ePlayer)10131{10132	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10133	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10134	if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; // -1 means it never happened, as defined in Reset()1013510136	return m_paiOtherPlayerTurnsSinceSidedWithTheirProtectedMinor[ePlayer];10137}

Called by