From 9f5d89b5f0e6e7fe6bccd7b909c62a4e6f8736b6 Mon Sep 17 00:00:00 2001 From: FN Date: Sat, 27 Apr 2024 17:40:39 +0700 Subject: [PATCH] Clean --- Content.Server/NPC/HTN/HTNSystem.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Content.Server/NPC/HTN/HTNSystem.cs b/Content.Server/NPC/HTN/HTNSystem.cs index acb0f22983d..e8a1ff4f48f 100644 --- a/Content.Server/NPC/HTN/HTNSystem.cs +++ b/Content.Server/NPC/HTN/HTNSystem.cs @@ -25,8 +25,6 @@ public sealed class HTNSystem : EntitySystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly NPCSystem _npc = default!; [Dependency] private readonly NPCUtilitySystem _utility = default!; - //[Dependency] private readonly SharedPhysicsSystem _physics = default!; - //[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly WorldControllerSystem _world = default!; private EntityQuery _xformQuery; @@ -259,15 +257,10 @@ public void UpdateNPC(ref int count, int maxUpdates, float frameTime) private bool IsNPCActive(HTNComponent component) { - if (!_xformQuery.TryGetComponent(component.Owner, out TransformComponent? xform)) + if (!_xformQuery.TryGetComponent(component.Owner, out TransformComponent? xform) || !_mapQuery.TryGetComponent(xform.MapUid, out var worldComponent)) return true; - /*return _physics.GetCollidingEntities(xform.MapID, Box2.CenteredAround(_transform.GetWorldPosition(xform), new(12))).Any(physicsComponent => physicsComponent.);*/ - - if (!_mapQuery.TryGetComponent(xform.MapUid, out var worldComponent)) - return true; - - return _loadedQuery.HasComponent(_world.GetOrCreateChunk(WorldGen.WorldToChunkCoords(xform.WorldPosition).Floored(), xform.MapUid!.Value, worldComponent)); + return _loadedQuery.HasComponent(_world.GetOrCreateChunk(WorldGen.WorldToChunkCoords(xform.WorldPosition).Floored(), xform.MapUid.Value, worldComponent)); } private void AppendDebugText(HTNTask task, StringBuilder text, List planBtr, List btr, ref int level)