From 7f2ceeb8e220b760da609add07a5caad4f41cac2 Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Tue, 5 Apr 2022 00:08:05 -0700 Subject: [PATCH] Small instrument system fix (#7432) --- Content.Server/Instruments/InstrumentSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index ece7c1252d..da509f2a7f 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -67,6 +67,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args) { + if (args.UiKey is not InstrumentUiKey) + return; + if (HasComp(uid) && _userInterfaceSystem.TryGetUi(uid, args.UiKey, out var bui) && bui.SubscribedSessions.Count == 0) @@ -79,6 +82,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem private void OnBoundUIOpened(EntityUid uid, InstrumentComponent component, BoundUIOpenedEvent args) { + if (args.UiKey is not InstrumentUiKey) + return; + EnsureComp(uid); Clean(uid, component); }