From 199794cf417e7695197148d18becb2dad5e99844 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 2 Mar 2018 17:46:48 +0200 Subject: [PATCH] Fixed exceptions when trying to save an itemcomponent that has been instantiated by calling the constructor directly (e.g. lightcomponents in wearables) --- .../BarotraumaShared/Source/Items/Components/ItemComponent.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs index abb75ebf3..c855ab328 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs @@ -182,6 +182,8 @@ namespace Barotrauma.Items.Components { this.item = item; + name = element.Name.ToString(); + properties = SerializableProperty.GetProperties(this); //canBePicked = ToolBox.GetAttributeBool(element, "canbepicked", false);