Bazaar developer reference

CvMinorCivAI::GetFriendshipLevelWithMajor(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 6710
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetFriendshipLevelWithMajor

Hooks

static bool BeforeCvMinorCivAI_GetFriendshipLevelWithMajor(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetFriendshipLevelWithMajor(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetFriendshipLevelWithMajor(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetFriendshipLevelWithMajor>(host, &BeforeCvMinorCivAI_GetFriendshipLevelWithMajor);CivRegisterAfter<CivHooks::CvMinorCivAI_GetFriendshipLevelWithMajor>(host, &AfterCvMinorCivAI_GetFriendshipLevelWithMajor);CivRegisterReplace<CivHooks::CvMinorCivAI_GetFriendshipLevelWithMajor>(host, &ReplaceCvMinorCivAI_GetFriendshipLevelWithMajor);

Code

6709/// What level of Friendship does a player have with this Minor?6710int CvMinorCivAI::GetFriendshipLevelWithMajor(PlayerTypes ePlayer)6711{6712	if(IsAllies(ePlayer))6713	{6714		return 2;6715	}6716	else if(IsFriends(ePlayer))6717	{6718		return 1;6719	}67206721	return 0;6722}

Calls

Called by