Hooks
static bool BeforeCvDiplomacyAI_SetCoopWarCounter(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, int iValue);static void AfterCvDiplomacyAI_SetCoopWarCounter(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, int iValue);static void ReplaceCvDiplomacyAI_SetCoopWarCounter(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetCoopWarCounter>(host, &BeforeCvDiplomacyAI_SetCoopWarCounter);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetCoopWarCounter>(host, &AfterCvDiplomacyAI_SetCoopWarCounter);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetCoopWarCounter>(host, &ReplaceCvDiplomacyAI_SetCoopWarCounter);
Code
20552void CvDiplomacyAI::SetCoopWarCounter(PlayerTypes ePlayer, PlayerTypes eTargetPlayer, int iValue)20553{20554 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20555 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.");20556 CvAssertMsg(eTargetPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20557 CvAssertMsg(eTargetPlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20558 m_ppaaiCoopWarCounter[ePlayer][eTargetPlayer] = iValue;20559}