diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index 772c999130..0213eb5902 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -707,17 +707,24 @@ public sealed class ChatUIController : UIController private void OnDamageForceSay(DamageForceSayEvent ev, EntitySessionEventArgs _) { var chatBox = UIManager.ActiveScreen?.GetWidget() ?? UIManager.ActiveScreen?.GetWidget(); + if (chatBox == null) + return; + + var msg = chatBox.ChatInput.Input.Text.TrimEnd(); // Don't send on OOC/LOOC obviously! - if (chatBox?.SelectedChannel is not (ChatSelectChannel.Local or - ChatSelectChannel.Radio or - ChatSelectChannel.Whisper)) + if (SplitInputContents(msg).chatChannel + is not ( + ChatSelectChannel.Local or + ChatSelectChannel.Radio or + ChatSelectChannel.Whisper + ) + ) return; if (_player.LocalSession?.AttachedEntity is not { } ent || !EntityManager.TryGetComponent(ent, out var forceSay)) return; - var msg = chatBox.ChatInput.Input.Text.TrimEnd(); if (string.IsNullOrWhiteSpace(msg)) return;