(541e3ffbe) Check that the mask is equipped in the head before trying to unequip.
This commit is contained in:
@@ -179,7 +179,7 @@ namespace Barotrauma
|
||||
if (takeMaskOff)
|
||||
{
|
||||
var mask = Character.Inventory.FindItemByIdentifier("divingmask");
|
||||
if (mask != null)
|
||||
if (mask != null && Character.Inventory.IsInLimbSlot(mask, InvSlotType.Head))
|
||||
{
|
||||
// Try to put the mask in an Any slot, and drop it if that fails
|
||||
if (!mask.AllowedSlots.Contains(InvSlotType.Any) || !Character.Inventory.TryPutItem(mask, Character, new List<InvSlotType>() { InvSlotType.Any }))
|
||||
|
||||
@@ -132,7 +132,8 @@ namespace Barotrauma
|
||||
{
|
||||
if (!character.SelectedItems.Contains(Weapon))
|
||||
{
|
||||
if (character.Inventory.TryPutItem(Weapon, 3, true, false, character))
|
||||
var slots = Weapon.AllowedSlots.FindAll(s => s == InvSlotType.LeftHand || s == InvSlotType.RightHand || s == (InvSlotType.LeftHand | InvSlotType.RightHand));
|
||||
if (character.Inventory.TryPutItem(Weapon, character, slots))
|
||||
{
|
||||
Weapon.Equip(character);
|
||||
}
|
||||
|
||||
@@ -26,10 +26,6 @@ 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)]
|
||||
|
||||
Reference in New Issue
Block a user