From 3eaec8bbc62ad4c2bdd05243fef808750075e5cd Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 11 Apr 2019 18:24:01 +0300 Subject: [PATCH] (c490f5118) Fixed bots not appearing to use repair tools or weapons client-side when repairing something or attacking (i.e. they aimed the item but never fired/used it) --- .../Source/Characters/AI/Objectives/AIObjectiveCombat.cs | 2 ++ .../Source/Items/Components/Holdable/RepairTool.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs index 6b7dda849..128992a3e 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveCombat.cs @@ -235,6 +235,7 @@ namespace Barotrauma { if (Vector2.DistanceSquared(character.Position, Enemy.Position) <= meleeWeapon.Range * meleeWeapon.Range) { + character.SetInput(InputType.Shoot, false, true); Weapon.Use(deltaTime, character); } } @@ -264,6 +265,7 @@ namespace Barotrauma } if (target != null && target == Enemy) { + character.SetInput(InputType.Shoot, false, true); Weapon.Use(deltaTime, character); } } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs index 08cef0492..36e56362a 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs @@ -322,6 +322,7 @@ namespace Barotrauma.Items.Components // If the character is climbing, ignore the check, because we cannot aim while climbing. if (VectorExtensions.Angle(VectorExtensions.Forward(item.body.TransformedRotation), fromItemToLeak) < MathHelper.PiOver4) { + character.SetInput(InputType.Shoot, false, true); Use(deltaTime, character); } else