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:
@@ -152,7 +152,11 @@ namespace Content.Server.GameObjects.Components
|
|||||||
}
|
}
|
||||||
if (Contents.CanInsert(entity))
|
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);
|
Contents.Insert(entity);
|
||||||
|
entity.Transform.WorldPosition = worldPos;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -163,7 +167,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
foreach (var contained in Contents.ContainedEntities.ToArray())
|
foreach (var contained in Contents.ContainedEntities.ToArray())
|
||||||
{
|
{
|
||||||
Contents.Remove(contained);
|
Contents.Remove(contained);
|
||||||
contained.Transform.WorldPosition = Owner.Transform.WorldPosition;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule RobustToolbox updated: 7fc99ee528...7239e70294
Reference in New Issue
Block a user