From 3b35ba056d50f56666896f063b521ed7f6c312b1 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 4 Apr 2019 11:12:32 +0300 Subject: [PATCH] (1a47431ff) Instead of displaying the red flash, automatically put the currently equipped item in the inventory (no matter if it's one or two handed) when picking up items that require two hands. If the item cannot be put into the inventory, the flash should be displayed (no auto dropping). --- .../Source/Items/CharacterInventory.cs | 13 ++++++++----- .../Items/Components/Signal/LightComponent.cs | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs index ad0f21640..f35cd6375 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs @@ -176,13 +176,16 @@ namespace Barotrauma { if (allowedSlot.HasFlag(SlotTypes[i]) && Items[i] != null && Items[i] != item) { - free = false; + if (!Items[i].AllowedSlots.Contains(InvSlotType.Any) || !TryPutItem(Items[i], character, new List { InvSlotType.Any }, true)) + { + free = false; #if CLIENT - for (int j = 0; j < capacity; j++) - { - if (slots != null && Items[j] == Items[i]) slots[j].ShowBorderHighlight(Color.Red, 0.1f, 0.9f); - } + for (int j = 0; j < capacity; j++) + { + if (slots != null && Items[j] == Items[i]) slots[j].ShowBorderHighlight(Color.Red, 0.1f, 0.9f); + } #endif + } } } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs index 7845f609c..eebf1146a 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs @@ -26,6 +26,10 @@ namespace Barotrauma.Items.Components private float blinkTimer; + private bool itemLoaded; + + private float blinkTimer; + public PhysicsBody ParentBody; [Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)]