Bazaar developer reference

CvMinorCivAI::IsCloseToNotBeingAllies(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 6688
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_IsCloseToNotBeingAllies

Hooks

static bool BeforeCvMinorCivAI_IsCloseToNotBeingAllies(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvMinorCivAI_IsCloseToNotBeingAllies(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvMinorCivAI_IsCloseToNotBeingAllies(bool (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_IsCloseToNotBeingAllies>(host, &BeforeCvMinorCivAI_IsCloseToNotBeingAllies);CivRegisterAfter<CivHooks::CvMinorCivAI_IsCloseToNotBeingAllies>(host, &AfterCvMinorCivAI_IsCloseToNotBeingAllies);CivRegisterReplace<CivHooks::CvMinorCivAI_IsCloseToNotBeingAllies>(host, &ReplaceCvMinorCivAI_IsCloseToNotBeingAllies);

Code

6687/// Are we about to lose our status? (used in Diplo AI)6688bool CvMinorCivAI::IsCloseToNotBeingAllies(PlayerTypes ePlayer)6689{6690	int iBuffer = GetEffectiveFriendshipWithMajor(ePlayer) - GetAlliesThreshold();66916692	if(iBuffer >= 0 && iBuffer < /*8*/ GC.getMINOR_FRIENDSHIP_CLOSE_AMOUNT())6693		return true;66946695	return false;6696}

Calls

Called by