From 1379460ad9db3cf03e1088a75f082753bd58ea1c Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 2 Aug 2018 11:22:49 +0300 Subject: [PATCH] Fixed holdable components reverting their RequiredItems back to the prefab values during loading. Closes #557 --- .../Source/Items/Components/Holdable/Holdable.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs index 5aa102b36..f0a7b89d2 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs @@ -124,6 +124,17 @@ namespace Barotrauma.Items.Components } } + public override void Load(XElement componentElement) + { + base.Load(componentElement); + if (attachable) + { + prevMsg = Msg; + prevPickKey = PickKey; + prevRequiredItems = new List(requiredItems); + } + } + public override void Drop(Character dropper) { Drop(true, dropper);