(a185ec0cd) Don't report on broken items that have condition above the threshold. Optimize and fix.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:41:25 +03:00
parent 79d01822d2
commit 1d5de494cd
84 changed files with 1733 additions and 1805 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>()?.User != character))
(character.SelectedConstruction == null || character.SelectedConstruction.GetComponent<Controller>() == null))
{
character.Inventory.Update(deltaTime, cam);
}
@@ -321,7 +321,7 @@ namespace Barotrauma
}
if (character.Inventory != null && !character.LockHands)
{
character.Inventory.Locked = (character.SelectedConstruction?.GetComponent<Controller>()?.User == character);
character.Inventory.Locked = (character.SelectedConstruction != null && character.SelectedConstruction.GetComponent<Controller>() != null);
character.Inventory.DrawOwn(spriteBatch);
character.Inventory.CurrentLayout = CharacterHealth.OpenHealthWindow == null && character.SelectedCharacter == null ?
CharacterInventory.Layout.Default :