From 7553d63a998f5fc2493d4bafb0478f92d4c6146a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 1 Aug 2017 18:04:30 +0300 Subject: [PATCH] Reverted 719f194 because it broke spawning items at world-space positions. Now the submarine-field of the body is simply set to match the item to make sure it gets rendered at the correct position. --- Barotrauma/BarotraumaShared/Source/Items/Item.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index 18817eaa9..3df13f4e6 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -361,6 +361,8 @@ namespace Barotrauma properties = ObjectProperty.InitProperties(this, element); + if (submarine == null || !submarine.Loading) FindHull(); + foreach (XElement subElement in element.Elements()) { switch (subElement.Name.ToString().ToLowerInvariant()) @@ -419,7 +421,10 @@ namespace Barotrauma } } - if (submarine == null || !submarine.Loading) FindHull(); + if (body != null) + { + body.Submarine = submarine; + } //cache connections into a dictionary for faster lookups var connectionPanel = GetComponent();