]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix glorfcode again (#22420)
authorKP <13428215+nok-ko@users.noreply.github.com>
Tue, 12 Dec 2023 21:57:54 +0000 (13:57 -0800)
committerGitHub <noreply@github.com>
Tue, 12 Dec 2023 21:57:54 +0000 (13:57 -0800)
Content.Client/UserInterface/Systems/Chat/ChatUIController.cs

index 772c999130dbde23ad62517de319afc1c92782aa..0213eb5902697670d94cfc93852d410ae4d4e27c 100644 (file)
@@ -707,17 +707,24 @@ public sealed class ChatUIController : UIController
     private void OnDamageForceSay(DamageForceSayEvent ev, EntitySessionEventArgs _)
     {
         var chatBox = UIManager.ActiveScreen?.GetWidget<ChatBox>() ?? UIManager.ActiveScreen?.GetWidget<ResizableChatBox>();
+        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<DamageForceSayComponent>(ent, out var forceSay))
             return;
 
-        var msg = chatBox.ChatInput.Input.Text.TrimEnd();
 
         if (string.IsNullOrWhiteSpace(msg))
             return;