diff --git a/Content.Server/Lock/LockSystem.cs b/Content.Server/Lock/LockSystem.cs index ad1b5fbd5f..8d24b016f2 100644 --- a/Content.Server/Lock/LockSystem.cs +++ b/Content.Server/Lock/LockSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Emag.Systems; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.Examine; +using Content.Shared.Hands.Components; using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Storage; @@ -152,6 +153,9 @@ namespace Content.Server.Lock if (!Resolve(uid, ref storage, logMissing: false)) return true; + if (!HasComp(user)) + return false; + // Cannot lock if the entity is currently opened. if (storage.Open) return false; diff --git a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs index 8f6c932b58..43e4100630 100644 --- a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Storage.Components; using Content.Server.Tools.Systems; using Content.Shared.Body.Components; using Content.Shared.Destructible; +using Content.Shared.Hands.Components; using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Placeable; @@ -148,7 +149,6 @@ public sealed class EntityStorageSystem : EntitySystem var ev = new StorageBeforeCloseEvent(uid, entities); RaiseLocalEvent(uid, ev, true); - var count = 0; foreach (var entity in ev.Contents) { @@ -233,6 +233,9 @@ public sealed class EntityStorageSystem : EntitySystem if (!Resolve(target, ref component)) return false; + if (!HasComp(user)) + return false; + if (component.IsWeldedShut) { if (!silent && !component.Contents.Contains(user)) @@ -361,6 +364,5 @@ public sealed class EntityStorageSystem : EntitySystem appearance.SetData(StorageVisuals.Open, component.Open); appearance.SetData(StorageVisuals.HasContents, component.Contents.ContainedEntities.Count() > 0); } - } }