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.
This commit is contained in:
Acruid
2019-09-15 15:29:16 -07:00
parent 3f4c9a8326
commit 311f843ea1
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}
}