diff --git a/Content.Server/NPC/HTN/HTNSystem.cs b/Content.Server/NPC/HTN/HTNSystem.cs index dd5dca52dc2..2c0a32c72b5 100644 --- a/Content.Server/NPC/HTN/HTNSystem.cs +++ b/Content.Server/NPC/HTN/HTNSystem.cs @@ -262,7 +262,9 @@ private bool IsNPCActive(EntityUid entity) if (!_mapQuery.TryGetComponent(transform.MapUid, out var worldComponent)) return true; - return _loadedQuery.HasComponent(_world.GetOrCreateChunk(WorldGen.WorldToChunkCoords(_transform.GetWorldPosition(transform)).Floored(), transform.MapUid.Value, worldComponent)); + var chunk = _world.GetOrCreateChunk(WorldGen.WorldToChunkCoords(_transform.GetWorldPosition(transform)).Floored(), transform.MapUid.Value, worldComponent); + + return _loadedQuery.TryGetComponent(chunk, out var loaded) && loaded.Loaders is not null; } private void AppendDebugText(HTNTask task, StringBuilder text, List planBtr, List btr, ref int level)