Add checks missing in the current half-implementation of lockable sto… (#8004)

This commit is contained in:
Rane
2022-05-08 01:18:53 -04:00
committed by GitHub
parent c01853d1fd
commit 87e3afd2ee

View File

@@ -191,6 +191,9 @@ namespace Content.Server.Storage.EntitySystems
if (!storageComp.ClickInsert)
return;
if (TryComp(uid, out LockComponent? lockComponent) && lockComponent.Locked)
return;
Logger.DebugS(storageComp.LoggerName, $"Storage (UID {uid}) attacked by user (UID {args.User}) with entity (UID {args.Used}).");
if (HasComp<PlaceableSurfaceComponent>(uid))
@@ -209,6 +212,9 @@ namespace Content.Server.Storage.EntitySystems
if (!TryComp<ActorComponent>(args.User, out var actor))
return;
if (TryComp(uid, out LockComponent? lockComponent) && lockComponent.Locked)
return;
OpenStorageUI(uid, args.User, storageComp);
}