From 4d01aba0f134bb90f9d20f747251ed8ca193779d Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 13 Feb 2018 13:49:41 +0200 Subject: [PATCH] Fixed subinventory staying visible if the slot containing the subinventory gets merged while it's highlighted (e.g. put a stun baton in either hand and swap it with a two-hand item) --- Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs index fd901a17b..c7dec1046 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs @@ -237,6 +237,7 @@ namespace Barotrauma { for (int i = 0; i < capacity - 1; i++) { + slots[i].State = GUIComponent.ComponentState.None; if (slots[i].Disabled || Items[i] == null) continue; for (int n = i + 1; n < capacity; n++) @@ -250,6 +251,8 @@ namespace Barotrauma } } + highlightedSubInventory = null; + highlightedSubInventorySlot = null; selectedSlot = null; }