From 3cc544705c24f163cb2394913e874f0b81c51b68 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 15 Apr 2025 06:15:16 +1000 Subject: [PATCH] Use approx NPC steering checks (#36110) Much faster lookup and shouldn't affect final result. --- Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs index 6a295198c2..c083be6134 100644 --- a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs +++ b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs @@ -507,7 +507,7 @@ public sealed partial class NPCSteeringSystem var objectRadius = 0.25f; var detectionRadius = MathF.Max(0.35f, agentRadius + objectRadius); var ents = _entSetPool.Get(); - _lookup.GetEntitiesInRange(uid, detectionRadius, ents, LookupFlags.Dynamic | LookupFlags.Static); + _lookup.GetEntitiesInRange(uid, detectionRadius, ents, LookupFlags.Dynamic | LookupFlags.Static | LookupFlags.Approximate); foreach (var ent in ents) { @@ -586,7 +586,7 @@ public sealed partial class NPCSteeringSystem var ourVelocity = body.LinearVelocity; _factionQuery.TryGetComponent(uid, out var ourFaction); var ents = _entSetPool.Get(); - _lookup.GetEntitiesInRange(uid, detectionRadius, ents, LookupFlags.Dynamic); + _lookup.GetEntitiesInRange(uid, detectionRadius, ents, LookupFlags.Dynamic | LookupFlags.Approximate); foreach (var ent in ents) {