From 1b5e5032f411de8239ee7e77cdea27a489e75b01 Mon Sep 17 00:00:00 2001 From: KP <13428215+nok-ko@users.noreply.github.com> Date: Mon, 11 Dec 2023 00:53:10 -0800 Subject: [PATCH] Fix Glorfcode (#22271) --- .../UserInterface/Systems/Chat/ChatUIController.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index e539394416..772c999130 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -706,17 +706,14 @@ public sealed class ChatUIController : UIController private void OnDamageForceSay(DamageForceSayEvent ev, EntitySessionEventArgs _) { - if (UIManager.ActiveScreen?.GetWidget() is not { } chatBox) - return; - + var chatBox = UIManager.ActiveScreen?.GetWidget() ?? UIManager.ActiveScreen?.GetWidget(); // Don't send on OOC/LOOC obviously! - if (chatBox.SelectedChannel is not - (ChatSelectChannel.Local or + if (chatBox?.SelectedChannel is not (ChatSelectChannel.Local or ChatSelectChannel.Radio or ChatSelectChannel.Whisper)) return; - if (_player.LocalPlayer?.ControlledEntity is not { } ent + if (_player.LocalSession?.AttachedEntity is not { } ent || !EntityManager.TryGetComponent(ent, out var forceSay)) return;