From 719f19418c8b29b7776992e94c8091554959a113 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 28 Jul 2017 17:29:44 +0300 Subject: [PATCH] Fixed invisible diving suits in respawn shuttles (and possible some other bugs): item constructor instantiates the physics body of the item before finding the hull the item is inside, because otherwise the submarine-field of the body won't be updated until the item moves, causing the item to be rendered at a complete wrong position. --- Barotrauma/BarotraumaShared/Source/Items/Item.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index ae694236a..18817eaa9 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -352,9 +352,7 @@ namespace Barotrauma tags = new HashSet(); rect = newRect; - - if (submarine==null || !submarine.Loading) FindHull(); - + condition = prefab.Health; lastSentCondition = prefab.Health; @@ -421,6 +419,8 @@ namespace Barotrauma } } + if (submarine == null || !submarine.Loading) FindHull(); + //cache connections into a dictionary for faster lookups var connectionPanel = GetComponent(); if (connectionPanel != null)