Increase NPC chase persistence (#12850)

This commit is contained in:
metalgearsloth
2022-12-07 10:34:23 +11:00
committed by GitHub
parent dd384c55a0
commit 540a3d9028
3 changed files with 17 additions and 8 deletions

View File

@@ -87,13 +87,20 @@ public sealed partial class NPCCombatSystem
return;
}
if (TryComp<NPCSteeringComponent>(component.Owner, out var steering) &&
steering.Status == SteeringStatus.NoPath)
{
component.Status = CombatStatus.TargetUnreachable;
return;
}
if (distance > weapon.Range)
{
component.Status = CombatStatus.TargetOutOfRange;
return;
}
var steering = EnsureComp<NPCSteeringComponent>(component.Owner);
steering = EnsureComp<NPCSteeringComponent>(component.Owner);
steering.Range = MathF.Max(0.2f, weapon.Range - 0.4f);
// Gets unregistered on component shutdown.