Janitor trashbag upgrade + FANCY ANIMATIONS (#3058)
* Janitor trashbag upgrade + FANCY ANIMATIONS * Review, Bug fixes and Sounds - Fixed hand-pickup animation playing if the entity originated from inside a container (e.g. bag on the ground) or from inside ourselves (e.g. something in our own inventory) * Fix/Change. Just log if AnimateEntityPickup is called with an entity that has no SpriteComponent. * More explicit log message. Error log. * Merge. Fix.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -176,9 +176,16 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
|
||||
Dirty();
|
||||
|
||||
var position = 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)
|
||||
{
|
||||
SendNetworkMessage(new AnimatePickupEntityMessage(item.Owner.Uid, position));
|
||||
}
|
||||
item.Owner.Transform.LocalPosition = Vector2.Zero;
|
||||
OnItemChanged?.Invoke();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user