Fix thrown breakables (#3944)

* Fix bottles and lights being parented to player

* Fix item pickup animation
This commit is contained in:
ShadowCommander
2021-05-08 11:27:20 -07:00
committed by GitHub
parent 55a04bfc30
commit 31844fa88e
2 changed files with 7 additions and 6 deletions

View File

@@ -172,15 +172,16 @@ namespace Content.Server.GameObjects.Components.GUI
Dirty();
var position = item.Owner.Transform.Coordinates;
var oldParent = item.Owner.Transform.Parent;
var oldPosition = item.Owner.Transform.Coordinates;
var contained = item.Owner.IsInContainer();
var success = hand.Container.Insert(item.Owner);
if (success)
{
//If the entity isn't in a container, and it isn't located exactly at our position (i.e. in our own storage), then we can safely play the animation
if (position != Owner.Transform.Coordinates && !contained)
if (oldParent != Owner.Transform && !contained)
{
SendNetworkMessage(new AnimatePickupEntityMessage(item.Owner.Uid, position));
SendNetworkMessage(new AnimatePickupEntityMessage(item.Owner.Uid, oldPosition));
}
item.Owner.Transform.LocalPosition = Vector2.Zero;
OnItemChanged?.Invoke();