From 4ad60e77a9f835acbcb8b93782829466d1bbc87d Mon Sep 17 00:00:00 2001 From: Regalis Date: Tue, 22 Nov 2016 18:06:52 +0200 Subject: [PATCH] Item.SetContainedItemPositions recursively sets the positions of the items contained inside the contained items (and so on) --- Subsurface/Source/Items/Item.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 59dd3a653..7172dd548 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -600,7 +600,7 @@ namespace Barotrauma { contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f); } - + contained.Rect = new Rectangle( (int)(displayPos.X - contained.Rect.Width / 2.0f), @@ -609,6 +609,8 @@ namespace Barotrauma contained.Submarine = Submarine; contained.CurrentHull = CurrentHull; + + contained.SetContainedItemPositions(); } }