From 17270bb321c78ac08c8139ff4a614890cee89cb2 Mon Sep 17 00:00:00 2001 From: KP <13428215+nok-ko@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:57:54 -0800 Subject: [PATCH] Fix glorfcode again (#22420) --- .../Systems/Chat/ChatUIController.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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; -- 2.51.2