Hooks
static bool BeforeCvDiplomacyAI_SetCoopWarAcceptedState(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, CoopWarStates eValue);static void AfterCvDiplomacyAI_SetCoopWarAcceptedState(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, CoopWarStates eValue);static void ReplaceCvDiplomacyAI_SetCoopWarAcceptedState(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes, CoopWarStates), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eTargetPlayer, CoopWarStates eValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetCoopWarAcceptedState>(host, &BeforeCvDiplomacyAI_SetCoopWarAcceptedState);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetCoopWarAcceptedState>(host, &AfterCvDiplomacyAI_SetCoopWarAcceptedState);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetCoopWarAcceptedState>(host, &ReplaceCvDiplomacyAI_SetCoopWarAcceptedState);
Code
20530void CvDiplomacyAI::SetCoopWarAcceptedState(PlayerTypes ePlayer, PlayerTypes eTargetPlayer, CoopWarStates eValue)20531{20532 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20533 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.");20534 CvAssertMsg(eTargetPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20535 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.");2053620537 if(eValue != GetCoopWarAcceptedState(ePlayer, eTargetPlayer))20538 {20539 m_ppaacCoopWarAcceptedState[ePlayer][eTargetPlayer] = eValue;20540 }20541}