diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index e8057c2af5..77eab4ac52 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.EntitySystems; @@ -80,6 +81,11 @@ namespace Content.Server.GameObjects.Components if (_noDoor && !_locked) Open = true; + + if (Owner.TryGetComponent(out var placeableSurfaceComponent)) + { + placeableSurfaceComponent.IsPlaceable = Open; + } } /// @@ -147,7 +153,7 @@ namespace Content.Server.GameObjects.Components // only items that can be stored in an inventory, or a player, can be eaten by a locker if(!entity.HasComponent() && !entity.HasComponent()) continue; - + if (!AddToContents(entity)) { continue; diff --git a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs index c27c5874ec..6c4cb1b619 100644 --- a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs +++ b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs @@ -20,9 +20,12 @@ namespace Content.Server.GameObjects.Components } public bool AttackBy(AttackByEventArgs eventArgs) { + if (!IsPlaceable) + return false; + if(!eventArgs.User.TryGetComponent(out var handComponent)) { - return true; + return false; } handComponent.Drop(eventArgs.AttackWith); eventArgs.AttackWith.Transform.WorldPosition = eventArgs.ClickLocation.Position;