From c56d56c2d186f60d1e666a392c296b230f0172db Mon Sep 17 00:00:00 2001 From: Acruid Date: Mon, 9 Sep 2019 14:50:12 -0700 Subject: [PATCH] Storage containers no longer eat the items out of a container, or eat world machines like APCs and Wires. Previously they would eat any entity that would fit inside them. This resolves https://github.com/space-wizards/space-station-14/issues/254. --- .../Components/Items/Storage/EntityStorageComponent.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 887266aafb..992f7c8ff8 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -5,6 +5,7 @@ using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Storage; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; +using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; @@ -66,6 +67,14 @@ namespace Content.Server.GameObjects.Components var count = 0; foreach (var entity in entities) { + // prevents taking items out of inventories, out of containers, and orphaning child entities + if(!entity.Transform.IsMapTransform) + continue; + + // 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;