diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index b4641928e48..7ea98c2fe12 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -39,6 +39,7 @@ using Content.Server.Shuttles.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Joints; +using Content.Shared.Atmos.Components; namespace Content.Server.Chat.Systems; @@ -506,7 +507,8 @@ private void SendEntityWhisper( if (session.AttachedEntity is not { Valid: true } listener) continue; - if (Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid + if (!HasComp(Transform(session.AttachedEntity.Value).MapUid) + && Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid && !CheckAttachedGrids(source, session.AttachedEntity.Value)) continue; @@ -712,7 +714,10 @@ private void SendInVoiceRange(ChatChannel channel, string name, string message, var language = languageOverride ?? _language.GetLanguage(source); foreach (var (session, data) in GetRecipients(source, Transform(source).GridUid == null ? 0.3f : VoiceRange)) { - if (session.AttachedEntity != null + if (session.AttachedEntity is not { Valid: true } playerEntity) + continue; + + if (!HasComp(Transform(session.AttachedEntity.Value).MapUid) && Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid && !CheckAttachedGrids(source, session.AttachedEntity.Value)) continue; @@ -721,11 +726,8 @@ private void SendInVoiceRange(ChatChannel channel, string name, string message, if (entRange == MessageRangeCheckResult.Disallowed) continue; var entHideChat = entRange == MessageRangeCheckResult.HideChat; - if (session.AttachedEntity is not { Valid: true } playerEntity) - continue; EntityUid listener = session.AttachedEntity.Value; - // If the channel does not support languages, or the entity can understand the message, send the original message, otherwise send the obfuscated version if (channel == ChatChannel.LOOC || channel == ChatChannel.Emotes || _language.CanUnderstand(listener, language.ID)) {