(a73e09604) Fixed inventory locking up when rewiring items with a Controller component (e.g. periscopes). Don't open the health interface by clicking on the healthbar when using a controller.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:39:42 +03:00
parent 3575c8df52
commit 704e0731c9
17 changed files with 200 additions and 276 deletions
@@ -86,7 +86,7 @@ namespace Barotrauma
if (character.Inventory != null)
{
if (!character.LockHands && character.Stun < 0.1f &&
(character.SelectedConstruction == null || character.SelectedConstruction.GetComponent<Controller>() == null))
(character.SelectedConstruction == null || character.SelectedConstruction?.GetComponent<Controller>()?.User != character))
{
character.Inventory.Update(deltaTime, cam);
}
@@ -321,7 +321,7 @@ namespace Barotrauma
}
if (character.Inventory != null && !character.LockHands)
{
character.Inventory.Locked = (character.SelectedConstruction != null && character.SelectedConstruction.GetComponent<Controller>() != null);
character.Inventory.Locked = (character.SelectedConstruction?.GetComponent<Controller>()?.User == character);
character.Inventory.DrawOwn(spriteBatch);
character.Inventory.CurrentLayout = CharacterHealth.OpenHealthWindow == null && character.SelectedCharacter == null ?
CharacterInventory.Layout.Default :