Selecting an item with no ItemContainer component doesn't prevent equipping/unequipping items by double clicking, added missing "gamescreen" console command

This commit is contained in:
Joonas Rikkonen
2017-07-13 23:33:53 +03:00
parent cc9ebe9fc2
commit d5aa1d8b97
2 changed files with 4 additions and 7 deletions
@@ -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) =>
@@ -251,13 +251,10 @@ namespace Barotrauma
}
else
{
if (character.SelectedConstruction != null)
var selectedContainer = character.SelectedConstruction?.GetComponent<ItemContainer>();
if (selectedContainer != null && selectedContainer.Inventory != null)
{
var selectedContainer = character.SelectedConstruction.GetComponent<ItemContainer>();
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)
{