Unstable v0.15.17.0 (Hex is out of town edition)

This commit is contained in:
Juan Pablo Arce
2021-12-03 13:31:10 -03:00
parent cd5c8f3e13
commit 617d9ede88
245 changed files with 8088 additions and 5842 deletions
@@ -283,9 +283,9 @@ namespace Barotrauma
/// </summary>
public float CalculatePriority()
{
ForceWalk = false;
Priority = GetPriority();
ForceHighestPriority = false;
ForceWalk = false;
return Priority;
}
@@ -501,5 +501,34 @@ namespace Barotrauma
}
}
}
protected static bool CanEquip(Character character, Item item)
{
bool canEquip = item != null;
if (canEquip && !item.AllowedSlots.Contains(InvSlotType.Any))
{
canEquip = false;
var inv = character.Inventory;
foreach (var allowedSlot in item.AllowedSlots)
{
foreach (var slotType in inv.SlotTypes)
{
if (!allowedSlot.HasFlag(slotType)) { continue; }
for (int i = 0; i < inv.Capacity; i++)
{
canEquip = true;
if (allowedSlot.HasFlag(inv.SlotTypes[i]) && inv.GetItemAt(i) != null)
{
canEquip = false;
break;
}
}
}
}
}
return canEquip;
}
protected bool CanEquip(Item item) => CanEquip(character, item);
}
}