Skip to content

Commit

Permalink
Reset relative of entities to 0 on pickup.
Browse files Browse the repository at this point in the history
This mostly helps with akwardness related to sound positioning.
  • Loading branch information
PJB3005 committed Mar 22, 2019
1 parent c27be2b commit 5b0f49b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using SS14.Shared.IoC;
using SS14.Shared.Log;
using SS14.Shared.Map;
using SS14.Shared.Maths;
using SS14.Shared.Serialization;
using SS14.Shared.Utility;
using SS14.Shared.ViewVariables;
Expand Down Expand Up @@ -137,7 +138,13 @@ public bool PutInHand(ItemComponent item, string index, bool fallback = true)

var slot = hands[index];
Dirty();
return slot.Insert(item.Owner);
var success = slot.Insert(item.Owner);
if (success)
{
item.Owner.Transform.LocalPosition = Vector2.Zero;
}

return success;
}

public bool CanPutInHand(ItemComponent item)
Expand Down

0 comments on commit 5b0f49b

Please sign in to comment.