From d8559ad63cb3758a54bb5c66f76aa00ca15af5a8 Mon Sep 17 00:00:00 2001 From: ursinewalrus Date: Tue, 31 Jul 2018 18:50:38 -0500 Subject: [PATCH] attaches item to wall where hand is, not at center of body --- .../Source/Items/Components/Holdable/Holdable.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs index f37c5e456..726c94ebc 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs @@ -160,7 +160,18 @@ namespace Barotrauma.Items.Components if (item.body != null) { item.body.ResetDynamics(); - item.SetTransform(picker.SimPosition, 0.0f); + Limb heldHand; + if (picker.Inventory.IsInLimbSlot(item, InvSlotType.LeftHand)) + { + heldHand = picker.AnimController.GetLimb(LimbType.LeftHand); + + } + else + { + heldHand = picker.AnimController.GetLimb(LimbType.RightHand); + } + + item.SetTransform(heldHand.SimPosition, 0.0f); } picker.DeselectItem(item);