Actors inside storage containers are now centered on the container.
This commit is contained in:
@@ -203,7 +203,15 @@ namespace Content.Server.GameObjects.Components
|
|||||||
{
|
{
|
||||||
// Because Insert sets the local position to (0,0), and we want to keep the contents spread out,
|
// 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.
|
// we re-apply the world position after inserting.
|
||||||
var worldPos = entity.Transform.WorldPosition;
|
Vector2 worldPos;
|
||||||
|
if (entity.HasComponent<IActorComponent>())
|
||||||
|
{
|
||||||
|
worldPos = Owner.Transform.WorldPosition;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
worldPos = entity.Transform.WorldPosition;
|
||||||
|
}
|
||||||
Contents.Insert(entity);
|
Contents.Insert(entity);
|
||||||
entity.Transform.WorldPosition = worldPos;
|
entity.Transform.WorldPosition = worldPos;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user