Bazaar developer reference

CvDiplomacyAI::IsOtherPlayerSidedWithProtectedMinor(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 10121
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor

Hooks

static bool BeforeCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor>(host, &BeforeCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor>(host, &AfterCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor>(host, &ReplaceCvDiplomacyAI_IsOtherPlayerSidedWithProtectedMinor);

Code

10120// We bullied or attacked their protected minor, and they didn't take our side!10121bool CvDiplomacyAI::IsOtherPlayerSidedWithProtectedMinor(PlayerTypes ePlayer)10122{10123	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10124	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Anton your save file and version.");10125	if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;1012610127	return (GetTurnsSinceOtherPlayerSidedWithProtectedMinor(ePlayer) >= 0); // -1 means it never happened, as defined in Reset()10128}

Calls

Called by