Fix glorfcode again (#22420)

This commit is contained in:
KP
2023-12-12 13:57:54 -08:00
committed by GitHub
parent 84fedaee13
commit 17270bb321

View 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
if (SplitInputContents(msg).chatChannel
is not (
ChatSelectChannel.Local or
ChatSelectChannel.Radio or
ChatSelectChannel.Whisper))
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;