CvDiplomacyAI::SetOtherPlayerProtectedMinorAttacked(PlayerTypes, PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 9952
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked
Hooks
static bool BeforeCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAttackedPlayer);static void AfterCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAttackedPlayer);static void ReplaceCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eAttackedPlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked>(host, &BeforeCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked>(host, &AfterCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked>(host, &ReplaceCvDiplomacyAI_SetOtherPlayerProtectedMinorAttacked);
Code
9951/// Sets who the last Minor that ePlayer attacked that we were protecting is9952void CvDiplomacyAI::SetOtherPlayerProtectedMinorAttacked(PlayerTypes ePlayer, PlayerTypes eAttackedPlayer)9953{9954 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9955 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9956 CvAssertMsg(eAttackedPlayer >= MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9957 CvAssertMsg(eAttackedPlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9958 m_paiOtherPlayerProtectedMinorAttacked[ePlayer] = eAttackedPlayer;9959}