From 0463e2d9cf1ad1aefe49555a3ca7f59d36c3bb9c Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sat, 24 Nov 2018 18:50:55 +0200 Subject: [PATCH] Inventory syncing fix: the inventory of the character that's being controlled would not be updated when the character can't access it (e.g. because of wearing handcuffs or being unconscious), preventing inventory updates from being applied. --- Barotrauma/BarotraumaClient/Source/Items/Inventory.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs b/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs index 135076d9e..bf3ff90e1 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Inventory.cs @@ -169,8 +169,6 @@ namespace Barotrauma public virtual void Update(float deltaTime, bool subInventory = false) { - syncItemsDelay = Math.Max(syncItemsDelay - deltaTime, 0.0f); - if (slots == null || isSubInventory != subInventory) { CreateSlots(); @@ -500,6 +498,7 @@ namespace Barotrauma { while (syncItemsDelay > 0.0f || (GameMain.Client != null && GameMain.Client.MidRoundSyncing)) { + syncItemsDelay = Math.Max((float)(syncItemsDelay - Timing.Step), 0.0f); yield return CoroutineStatus.Running; }