From f5e662846549825f33e7cd55711f24ec6d760faf Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 25 Dec 2022 11:29:52 +1100 Subject: [PATCH] NPC separation adjustments (#13176) --- Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs index 34c53b8e98..93302861da 100644 --- a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs +++ b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs @@ -394,7 +394,8 @@ public sealed partial class NPCSteeringSystem (layer & otherBody.CollisionMask) == 0x0 || !factionQuery.TryGetComponent(ent, out var otherFaction) || !_faction.IsFriendly(uid, ent, ourFaction, otherFaction) || - Vector2.Dot(otherBody.LinearVelocity, ourVelocity) < 0f) + // Use <= 0 so we ignore stationary friends in case. + Vector2.Dot(otherBody.LinearVelocity, ourVelocity) <= 0f) { continue; } @@ -415,7 +416,7 @@ public sealed partial class NPCSteeringSystem obstacleDirection = offsetRot.RotateVec(obstacleDirection); var norm = obstacleDirection.Normalized; var weight = obstableDistance <= agentRadius ? 1f : (detectionRadius - obstableDistance) / detectionRadius; - weight *= 1.5f; + weight *= 1f; for (var i = 0; i < InterestDirections; i++) {