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

@@ -243,11 +243,6 @@ namespace Content.Server.NPC.Systems
var direction = targetMap.Position - ourMap.Position;
if (steering.Owner == new EntityUid(15315))
{
}
// Are we in range
if (direction.Length <= arrivalDistance)
{
@@ -318,6 +313,12 @@ namespace Content.Server.NPC.Systems
// TODO: Probably need partial planning support i.e. patch from the last node to where the target moved to.
CheckPath(steering, xform, needsPath, distance);
if (steering.Pathfind && steering.CurrentPath.Count == 0)
{
SetDirection(mover, steering, Vector2.Zero, false);
return;
}
modifierQuery.TryGetComponent(steering.Owner, out var modifier);
var moveSpeed = GetSprintSpeed(steering.Owner, modifier);