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;