Core/Handlers: fix ".whisper on" with opposite faction/low level
Port From (https://github.com/TrinityCore/TrinityCore/commit/0b556d8a9183a8109a8559473c32a55405bd30df)
This commit is contained in:
@@ -2156,7 +2156,8 @@ namespace Game.Entities
|
||||
else
|
||||
m_ExtraFlags &= ~PlayerExtraFlags.AcceptWhispers;
|
||||
}
|
||||
public bool IsGameMaster() { return Convert.ToBoolean(m_ExtraFlags & PlayerExtraFlags.GMOn); }
|
||||
public bool IsGameMaster() { return m_ExtraFlags.HasAnyFlag(PlayerExtraFlags.GMOn); }
|
||||
public bool IsGameMasterAcceptingWhispers() { return IsGameMaster() && IsAcceptWhispers(); }
|
||||
public bool CanBeGameMaster() { return GetSession().HasPermission(RBACPermissions.CommandGm); }
|
||||
public void SetGameMaster(bool on)
|
||||
{
|
||||
|
||||
@@ -233,16 +233,21 @@ namespace Game
|
||||
SendChatPlayerNotfoundNotice(target);
|
||||
return;
|
||||
}
|
||||
if (!sender.IsGameMaster() && sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq) && !receiver.IsInWhisperWhiteList(sender.GetGUID()))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.WhisperReq), WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq));
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().GetTeam() != receiver.GetTeam() && !HasPermission(RBACPermissions.TwoSideInteractionChat) && !receiver.IsInWhisperWhiteList(sender.GetGUID()))
|
||||
// Apply checks only if receiver is not already in whitelist and if receiver is not a GM with ".whisper on"
|
||||
if (!receiver.IsInWhisperWhiteList(sender.GetGUID()) && !receiver.IsGameMasterAcceptingWhispers())
|
||||
{
|
||||
SendChatPlayerNotfoundNotice(target);
|
||||
return;
|
||||
if (!sender.IsGameMaster() && sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.WhisperReq), WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq));
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().GetTeam() != receiver.GetTeam() && !HasPermission(RBACPermissions.TwoSideInteractionChat) && !receiver.IsInWhisperWhiteList(sender.GetGUID()))
|
||||
{
|
||||
SendChatPlayerNotfoundNotice(target);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetPlayer().HasAura(1852) && !receiver.IsGameMaster())
|
||||
|
||||
Reference in New Issue
Block a user