Fixed 4014 (#4033)

Co-authored-by: Michael Will <will_m@outlook.de>
This commit is contained in:
scrato
2021-05-20 14:58:28 +02:00
committed by GitHub
parent f3de5c4f33
commit 80a864724b

View File

@@ -20,6 +20,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
namespace Content.Server.GameObjects.Components.Access namespace Content.Server.GameObjects.Components.Access
{ {
@@ -33,6 +34,7 @@ namespace Content.Server.GameObjects.Components.Access
private ContainerSlot _targetIdContainer = default!; private ContainerSlot _targetIdContainer = default!;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(IdCardConsoleUiKey.Key); [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(IdCardConsoleUiKey.Key);
[ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;
private bool PrivilegedIDEmpty => _privilegedIdContainer.ContainedEntities.Count < 1; private bool PrivilegedIDEmpty => _privilegedIdContainer.ContainedEntities.Count < 1;
private bool TargetIDEmpty => _targetIdContainer.ContainedEntities.Count < 1; private bool TargetIDEmpty => _targetIdContainer.ContainedEntities.Count < 1;
@@ -218,6 +220,7 @@ namespace Content.Server.GameObjects.Components.Access
{ {
return; return;
} }
if(!Powered) return;
UserInterface?.Open(actor.PlayerSession); UserInterface?.Open(actor.PlayerSession);
} }