Small instrument system fix (#7432)
This commit is contained in:
@@ -67,6 +67,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
|||||||
|
|
||||||
private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args)
|
private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args)
|
||||||
{
|
{
|
||||||
|
if (args.UiKey is not InstrumentUiKey)
|
||||||
|
return;
|
||||||
|
|
||||||
if (HasComp<ActiveInstrumentComponent>(uid)
|
if (HasComp<ActiveInstrumentComponent>(uid)
|
||||||
&& _userInterfaceSystem.TryGetUi(uid, args.UiKey, out var bui)
|
&& _userInterfaceSystem.TryGetUi(uid, args.UiKey, out var bui)
|
||||||
&& bui.SubscribedSessions.Count == 0)
|
&& bui.SubscribedSessions.Count == 0)
|
||||||
@@ -79,6 +82,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
|||||||
|
|
||||||
private void OnBoundUIOpened(EntityUid uid, InstrumentComponent component, BoundUIOpenedEvent args)
|
private void OnBoundUIOpened(EntityUid uid, InstrumentComponent component, BoundUIOpenedEvent args)
|
||||||
{
|
{
|
||||||
|
if (args.UiKey is not InstrumentUiKey)
|
||||||
|
return;
|
||||||
|
|
||||||
EnsureComp<ActiveInstrumentComponent>(uid);
|
EnsureComp<ActiveInstrumentComponent>(uid);
|
||||||
Clean(uid, component);
|
Clean(uid, component);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user