From d5aa1d8b979b8160956bf037e917970d46e49186 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 13 Jul 2017 23:33:53 +0300 Subject: [PATCH] Selecting an item with no ItemContainer component doesn't prevent equipping/unequipping items by double clicking, added missing "gamescreen" console command --- Barotrauma/BarotraumaClient/Source/DebugConsole.cs | 2 +- .../BarotraumaShared/Source/Items/CharacterInventory.cs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index 636a5c6f1..407a3f2f5 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -206,7 +206,7 @@ namespace Barotrauma commands.Add(new Command("gamescreen|game", "gamescreen/game: Go to the \"in-game\" view.", (string[] args) => { - + GameMain.GameScreen.Select(); })); commands.Add(new Command("editsubscreen|editsub|subeditor", "editsub/subeditor: Switch to the submarine editor.", (string[] args) => diff --git a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs index 672b78140..561c6799a 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs @@ -251,13 +251,10 @@ namespace Barotrauma } else { - if (character.SelectedConstruction != null) + var selectedContainer = character.SelectedConstruction?.GetComponent(); + if (selectedContainer != null && selectedContainer.Inventory != null) { - var selectedContainer = character.SelectedConstruction.GetComponent(); - if (selectedContainer != null && selectedContainer.Inventory != null) - { - selectedContainer.Inventory.TryPutItem(doubleClickedItem, doubleClickedItem.AllowedSlots, true); - } + selectedContainer.Inventory.TryPutItem(doubleClickedItem, doubleClickedItem.AllowedSlots, true); } else if (character.SelectedCharacter != null && character.SelectedCharacter.Inventory != null) {