From 60382e2f6272e45b329076c504fcc35176dc8135 Mon Sep 17 00:00:00 2001 From: sleepyyapril Date: Mon, 30 Dec 2024 18:53:03 -0400 Subject: [PATCH] NanoChat fixes --- Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs b/Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs index 0a53122f87e..6f035047997 100644 --- a/Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs +++ b/Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.DeltaV.CartridgeLoader.Cartridges; using Content.Shared.Examine; +using Content.Shared.PDA; using Robust.Shared.Timing; namespace Content.Shared.DeltaV.NanoChat; @@ -10,6 +11,7 @@ namespace Content.Shared.DeltaV.NanoChat; public abstract class SharedNanoChatSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly SharedUserInterfaceSystem _ui = default!; public override void Initialize() { @@ -139,6 +141,10 @@ public void AddMessage(Entity card, uint recipientNumber if (!Resolve(card, ref card.Comp)) return null; + // If the UI is not open, no one is technically selected. + if (!_ui.IsUiOpen(card.Owner, PdaUiKey.Key)) + return null; + return card.Comp.CurrentChat; }