From 87e3afd2eed304d128989f7b5d952e6613630e28 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Sun, 8 May 2022 01:18:53 -0400 Subject: [PATCH] =?UTF-8?q?Add=20checks=20missing=20in=20the=20current=20h?= =?UTF-8?q?alf-implementation=20of=20lockable=20sto=E2=80=A6=20(#8004)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Storage/EntitySystems/StorageSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index 0b013babfc..90d1c40815 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -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(uid)) @@ -209,6 +212,9 @@ namespace Content.Server.Storage.EntitySystems if (!TryComp(args.User, out var actor)) return; + if (TryComp(uid, out LockComponent? lockComponent) && lockComponent.Locked) + return; + OpenStorageUI(uid, args.User, storageComp); }