From: KP <13428215+nok-ko@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:53:10 +0000 (-0800) Subject: Fix Glorfcode (#22271) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1b5e5032f411de8239ee7e77cdea27a489e75b01;p=space-station-14.git Fix Glorfcode (#22271) --- 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;