From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:15:16 +0000 (+1000) Subject: Use approx NPC steering checks (#36110) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3cc544705c24f163cb2394913e874f0b81c51b68;p=space-station-14.git Use approx NPC steering checks (#36110) Much faster lookup and shouldn't affect final result. --- 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) {