Storage: fix Storage insert anim with _quickInsert or _areaInsert set (#4877)

Turns out the final position calculations were wrong, so I copied/pasted
from the equivalent parts of the Hands components.

Unfortunately, this means that picking up trash with a trash bag no
longer causes said trash to rapidly zoom to 0,0.
This commit is contained in:
E F R
2021-10-20 13:25:22 +00:00
committed by GitHub
parent bdfab0263b
commit 5a03c0eca8

View File

@@ -543,11 +543,11 @@ namespace Content.Server.Storage.Components
|| entity == eventArgs.User
|| !entity.HasComponent<SharedItemComponent>())
continue;
var coords = entity.Transform.Coordinates;
var position = EntityCoordinates.FromMap(Owner.Transform.Parent?.Owner ?? Owner, entity.Transform.MapPosition);
if (PlayerInsertEntityInWorld(eventArgs.User, entity))
{
successfullyInserted.Add(entity.Uid);
successfullyInsertedPositions.Add(coords);
successfullyInsertedPositions.Add(position);
}
}
@@ -572,7 +572,7 @@ namespace Content.Server.Storage.Components
|| eventArgs.Target == eventArgs.User
|| !eventArgs.Target.HasComponent<SharedItemComponent>())
return false;
var position = eventArgs.Target.Transform.Coordinates;
var position = EntityCoordinates.FromMap(Owner.Transform.Parent?.Owner ?? Owner, eventArgs.Target.Transform.MapPosition);
if (PlayerInsertEntityInWorld(eventArgs.User, eventArgs.Target))
{
SendNetworkMessage(new AnimateInsertingEntitiesMessage(