(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).

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:12:32 +03:00
parent 709d9e44ab
commit 3b35ba056d
2 changed files with 12 additions and 5 deletions
@@ -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> { 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
}
}
}
@@ -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)]