NPC obstacle fixes (#15645)

This commit is contained in:
metalgearsloth
2023-04-22 18:57:19 +10:00
committed by GitHub
parent 2d45d97266
commit 9361b0b469
2 changed files with 436 additions and 431 deletions

View File

@@ -98,7 +98,7 @@ public sealed partial class NPCSteeringSystem
// TODO: Consider melee range or the likes. // TODO: Consider melee range or the likes.
else else
{ {
arrivalDistance = SharedInteractionSystem.InteractionRange - 0.65f; arrivalDistance = SharedInteractionSystem.InteractionRange - 0.05f;
} }
// Check if mapids match. // Check if mapids match.
@@ -126,6 +126,12 @@ public sealed partial class NPCSteeringSystem
// Breaking behaviours and the likes. // Breaking behaviours and the likes.
lock (_obstacles) lock (_obstacles)
{ {
// We're still coming to a stop so wait for the do_after.
if (body.LinearVelocity.LengthSquared > 0.01f)
{
return true;
}
status = TryHandleFlags(uid, steering, node, bodyQuery); status = TryHandleFlags(uid, steering, node, bodyQuery);
} }

View File

@@ -28,8 +28,8 @@ using Robust.Shared.Threading;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Server.NPC.Systems namespace Content.Server.NPC.Systems;
{
public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
{ {
/* /*
@@ -477,4 +477,3 @@ namespace Content.Server.NPC.Systems
return modifier.CurrentSprintSpeed; return modifier.CurrentSprintSpeed;
} }
} }
}