From 311f843ea1f055e077cb8ca395a1ba7ce1f07fbc Mon Sep 17 00:00:00 2001 From: Acruid Date: Sun, 15 Sep 2019 15:29:16 -0700 Subject: [PATCH] Keeps the items inside a storage container spread out with a small local offset. Previously, all of the items were set to the container's position, resulting in a single pile. Updates engine submodule. --- .../Components/Items/Storage/EntityStorageComponent.cs | 5 ++++- RobustToolbox | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 992f7c8ff8..8149ea9201 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -152,7 +152,11 @@ namespace Content.Server.GameObjects.Components } if (Contents.CanInsert(entity)) { + // Because Insert sets the local position to (0,0), and we want to keep the contents spread out, + // we re-apply the world position after inserting. + var worldPos = entity.Transform.WorldPosition; Contents.Insert(entity); + entity.Transform.WorldPosition = worldPos; return true; } return false; @@ -163,7 +167,6 @@ namespace Content.Server.GameObjects.Components foreach (var contained in Contents.ContainedEntities.ToArray()) { Contents.Remove(contained); - contained.Transform.WorldPosition = Owner.Transform.WorldPosition; } } diff --git a/RobustToolbox b/RobustToolbox index 7fc99ee528..7239e70294 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 7fc99ee52803171fc12ce83117d32cbc35849ae1 +Subproject commit 7239e702941b7956f186b4cde9b34a6d3f79f40d