Bazaar developer reference

CvPlayer::HasEmbassyWith(PlayerTypes) const

Defined in
CvPlayer.cpp, line 28515
Class
CvPlayer
Hook name
CivHooks::CvPlayer_HasEmbassyWith

Hooks

static bool BeforeCvPlayer_HasEmbassyWith(const CvPlayer* self, PlayerTypes eOtherPlayer, bool& result);static void AfterCvPlayer_HasEmbassyWith(const CvPlayer* self, PlayerTypes eOtherPlayer, bool& result);static bool ReplaceCvPlayer_HasEmbassyWith(bool (*original)(const CvPlayer*, PlayerTypes), const CvPlayer* self, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvPlayer_HasEmbassyWith>(host, &BeforeCvPlayer_HasEmbassyWith);CivRegisterAfter<CivHooks::CvPlayer_HasEmbassyWith>(host, &AfterCvPlayer_HasEmbassyWith);CivRegisterReplace<CivHooks::CvPlayer_HasEmbassyWith>(host, &ReplaceCvPlayer_HasEmbassyWith);

Code

28515bool CvPlayer::HasEmbassyWith(PlayerTypes eOtherPlayer) const28516{28517	if (eOtherPlayer >= 0 && eOtherPlayer < MAX_MAJOR_CIVS) {28518		CvPlayer& kOtherPlayer = GET_PLAYER(eOtherPlayer);2851928520		return (kOtherPlayer.isAlive() && GET_TEAM(getTeam()).HasEmbassyAtTeam(kOtherPlayer.getTeam()));28521	}2852228523	return false;28524}

Calls

Called by