Core/Chat: Corrected chat channel flag implementations

Port From (https://github.com/TrinityCore/TrinityCore/commit/d2baaac9ec9c0b0839d5868d9666aa0901031b28)
This commit is contained in:
hondacrx
2024-02-01 10:10:38 -05:00
parent a436f7b2d1
commit d68f52bdc3
8 changed files with 91 additions and 51 deletions
+4
View File
@@ -334,6 +334,10 @@ namespace Game
Channel chn = !channelGuid.IsEmpty() ? ChannelManager.GetChannelForPlayerByGuid(channelGuid, sender) : ChannelManager.GetChannelForPlayerByNamePart(target, sender);
if (chn != null)
{
var chatChannel = CliDB.ChatChannelsStorage.LookupByKey(chn.GetChannelId());
if (chatChannel != null && chatChannel.GetFlags().HasFlag(ChatChannelFlags.ReadOnly))
return;
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, chn);
chn.Say(GetPlayer().GetGUID(), msg, lang);
}