From ec31e86350d2b1f7168aa782499cff97e1369af9 Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 20 Mar 2017 21:16:21 +0200 Subject: [PATCH] Server sets the condition of an item back to 100 when the item is fixed --- Subsurface/Source/Items/Item.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index a80922f8f..07d9fae0b 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -1849,11 +1849,16 @@ namespace Barotrauma int requirementIndex = FixRequirements.Count == 1 ? 0 : msg.ReadRangedInteger(0, FixRequirements.Count - 1); - + if (c.Character == null || !c.Character.CanAccessItem(this)) return; if (!FixRequirements[requirementIndex].CanBeFixed(c.Character)) return; FixRequirements[requirementIndex].Fixed = true; + if (condition <= 0.0f && FixRequirements.All(f => f.Fixed)) + { + Condition = 100.0f; + } + GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); break;