From 4e45876a6cfd38789c343b57c41728bdd3a95fb6 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 4 Apr 2019 11:11:51 +0300 Subject: [PATCH] (502e453a9) Instead of placing the weapon to a slot 3, find the allowed hand slots. --- .../Source/Characters/AI/Objectives/AIObjectiveCombat.cs | 3 ++- .../Source/Items/Components/Signal/LightComponent.cs | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs index 0d4f621fd..b6d020d2a 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs @@ -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); } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs index eebf1146a..7845f609c 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/LightComponent.cs @@ -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)]