CvDiplomacyAI::IsOpenBordersExchangeAcceptable(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 5129
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsOpenBordersExchangeAcceptable
Hooks
static bool BeforeCvDiplomacyAI_IsOpenBordersExchangeAcceptable(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsOpenBordersExchangeAcceptable(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsOpenBordersExchangeAcceptable(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsOpenBordersExchangeAcceptable>(host, &BeforeCvDiplomacyAI_IsOpenBordersExchangeAcceptable);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsOpenBordersExchangeAcceptable>(host, &AfterCvDiplomacyAI_IsOpenBordersExchangeAcceptable);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsOpenBordersExchangeAcceptable>(host, &ReplaceCvDiplomacyAI_IsOpenBordersExchangeAcceptable);
Code
5128/// Are we willing to swap Open Borders with ePlayer?5129bool CvDiplomacyAI::IsOpenBordersExchangeAcceptable(PlayerTypes ePlayer)5130{5131 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");5132 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.");51335134 MajorCivApproachTypes eApproach = GetMajorCivApproach(ePlayer, /*bHideTrueFeelings*/ true);51355136 if(eApproach == MAJOR_CIV_APPROACH_FRIENDLY)5137 return true;5138 else if(eApproach == MAJOR_CIV_APPROACH_AFRAID)5139 return true;51405141 return false;5142}