Reduce NPC static collision avoidance range (#13197)
This commit is contained in:
@@ -320,7 +320,7 @@ public sealed partial class NPCSteeringSystem
|
||||
EntityQuery<PhysicsComponent> bodyQuery,
|
||||
EntityQuery<TransformComponent> xformQuery)
|
||||
{
|
||||
var detectionRadius = agentRadius + moveSpeed;
|
||||
var detectionRadius = MathF.Max(1.5f, agentRadius + moveSpeed / 4f);
|
||||
|
||||
foreach (var ent in _lookup.GetEntitiesInRange(uid, detectionRadius, LookupFlags.Static))
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace Content.Server.NPC.Systems
|
||||
var modifierQuery = GetEntityQuery<MovementSpeedModifierComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
|
||||
var npcs = EntityQuery<NPCSteeringComponent, ActiveNPCComponent, InputMoverComponent, TransformComponent>()
|
||||
var npcs = EntityQuery<ActiveNPCComponent, NPCSteeringComponent, InputMoverComponent, TransformComponent>()
|
||||
.ToArray();
|
||||
var options = new ParallelOptions
|
||||
{
|
||||
@@ -213,7 +213,7 @@ namespace Content.Server.NPC.Systems
|
||||
|
||||
Parallel.For(0, npcs.Length, options, i =>
|
||||
{
|
||||
var (steering, _, mover, xform) = npcs[i];
|
||||
var (_, steering, mover, xform) = npcs[i];
|
||||
|
||||
Steer(steering, mover, xform, modifierQuery, bodyQuery, xformQuery, frameTime);
|
||||
});
|
||||
@@ -223,7 +223,7 @@ namespace Content.Server.NPC.Systems
|
||||
{
|
||||
var data = new List<NPCSteeringDebugData>(npcs.Length);
|
||||
|
||||
foreach (var (steering, _, mover, _) in npcs)
|
||||
foreach (var (_, steering, mover, _) in npcs)
|
||||
{
|
||||
data.Add(new NPCSteeringDebugData(
|
||||
mover.Owner,
|
||||
|
||||
Reference in New Issue
Block a user