From 834890faec00ea82630e4179d0b78ddb4d632000 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 20 Oct 2024 13:23:17 -0400 Subject: [PATCH] Revert "Allow Talking Across Atmosphere (#1089)" This reverts commit 9ddd9679eccce166e8fe99fab01377c1bf950d58. --- Content.Server/Chat/Systems/ChatSystem.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 7ea98c2fe12..b4641928e48 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -39,7 +39,6 @@ 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; @@ -507,8 +506,7 @@ private void SendEntityWhisper( if (session.AttachedEntity is not { Valid: true } listener) continue; - if (!HasComp(Transform(session.AttachedEntity.Value).MapUid) - && Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid + if (Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid && !CheckAttachedGrids(source, session.AttachedEntity.Value)) continue; @@ -714,10 +712,7 @@ 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 is not { Valid: true } playerEntity) - continue; - - if (!HasComp(Transform(session.AttachedEntity.Value).MapUid) + if (session.AttachedEntity != null && Transform(session.AttachedEntity.Value).GridUid != Transform(source).GridUid && !CheckAttachedGrids(source, session.AttachedEntity.Value)) continue; @@ -726,8 +721,11 @@ 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)) {