From ef5614530843f93406eea71d152a8cac0788ccd3 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 13 Nov 2022 20:57:14 +1100 Subject: [PATCH] Bump NPC melee range for steering (#12570) --- Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs b/Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs index fda35bda32..d421efc357 100644 --- a/Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs +++ b/Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs @@ -93,8 +93,11 @@ public sealed partial class NPCCombatSystem return; } + var steering = EnsureComp(component.Owner); + steering.Range = MathF.Max(0.2f, weapon.Range - 0.4f); + // Gets unregistered on component shutdown. - _steering.TryRegister(component.Owner, new EntityCoordinates(component.Target, Vector2.Zero)); + _steering.TryRegister(component.Owner, new EntityCoordinates(component.Target, Vector2.Zero), steering); _melee.AttemptLightAttack(component.Owner, weapon, component.Target); } }