Skip to content

Commit

Permalink
NanoChat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Dec 30, 2024
1 parent 471c3c2 commit 60382e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -139,6 +141,10 @@ public void AddMessage(Entity<NanoChatCardComponent?> 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;
}

Expand Down

0 comments on commit 60382e2

Please sign in to comment.