(502e453a9) Instead of placing the weapon to a slot 3, find the allowed hand slots.

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:11:51 +03:00
parent a7899b4b08
commit 4e45876a6c
2 changed files with 2 additions and 5 deletions
@@ -132,7 +132,8 @@ namespace Barotrauma
{ {
if (!character.SelectedItems.Contains(Weapon)) 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); Weapon.Equip(character);
} }
@@ -26,10 +26,6 @@ namespace Barotrauma.Items.Components
private float blinkTimer; private float blinkTimer;
private bool itemLoaded;
private float blinkTimer;
public PhysicsBody ParentBody; public PhysicsBody ParentBody;
[Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)] [Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)]