From: KP <13428215+nok-ko@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:57:54 +0000 (-0800) Subject: Fix glorfcode again (#22420) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=17270bb321c78ac08c8139ff4a614890cee89cb2;p=space-station-14.git Fix glorfcode again (#22420) --- 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;