Bazaar developer reference

CvPlayer::IsAllowedToTradeWith(PlayerTypes)

Defined in
CvPlayer.cpp, line 27308
Class
CvPlayer
Hook name
CivHooks::CvPlayer_IsAllowedToTradeWith

Hooks

static bool BeforeCvPlayer_IsAllowedToTradeWith(CvPlayer* self, PlayerTypes eOtherPlayer, bool& result);static void AfterCvPlayer_IsAllowedToTradeWith(CvPlayer* self, PlayerTypes eOtherPlayer, bool& result);static bool ReplaceCvPlayer_IsAllowedToTradeWith(bool (*original)(CvPlayer*, PlayerTypes), CvPlayer* self, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvPlayer_IsAllowedToTradeWith>(host, &BeforeCvPlayer_IsAllowedToTradeWith);CivRegisterAfter<CivHooks::CvPlayer_IsAllowedToTradeWith>(host, &AfterCvPlayer_IsAllowedToTradeWith);CivRegisterReplace<CivHooks::CvPlayer_IsAllowedToTradeWith>(host, &ReplaceCvPlayer_IsAllowedToTradeWith);

Code

27308bool CvPlayer::IsAllowedToTradeWith(PlayerTypes eOtherPlayer)27309{27310	if (GC.getGame().GetGameLeagues()->IsTradeEmbargoed(GetID(), eOtherPlayer) && eOtherPlayer != m_eID)27311	{27312		return false;27313	}2731427315	return true;27316}

Calls

Called by