CvDiplomacyAI::IsStopSpyingAcceptable(PlayerTypes) const
- Defined in
- CvDiplomacyAI.cpp, line 21001
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsStopSpyingAcceptable
Hooks
static bool BeforeCvDiplomacyAI_IsStopSpyingAcceptable(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsStopSpyingAcceptable(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsStopSpyingAcceptable(bool (*original)(const CvDiplomacyAI*, PlayerTypes), const CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsStopSpyingAcceptable>(host, &BeforeCvDiplomacyAI_IsStopSpyingAcceptable);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsStopSpyingAcceptable>(host, &AfterCvDiplomacyAI_IsStopSpyingAcceptable);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsStopSpyingAcceptable>(host, &ReplaceCvDiplomacyAI_IsStopSpyingAcceptable);
Code
21000/// Is this AI willing to stop spying on ePlayer?21001bool CvDiplomacyAI::IsStopSpyingAcceptable(PlayerTypes ePlayer) const21002{21003 MajorCivApproachTypes eApproach = GetMajorCivApproach(ePlayer, /*bHideTrueFeelings*/ true);2100421005 // If player is afraid, always say yes21006 if(eApproach == MAJOR_CIV_APPROACH_AFRAID)21007 return true;2100821009 // If player is Hostile, always say no21010 else if(eApproach == MAJOR_CIV_APPROACH_HOSTILE)21011 return false;2101221013 MajorCivOpinionTypes eOpinion = GetMajorCivOpinion(ePlayer);2101421015 // If player is unforgivable, always say no21016 if(eOpinion == MAJOR_CIV_OPINION_UNFORGIVABLE)21017 return false;2101821019 return true;21020}