Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Fix loader check
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed May 12, 2024
1 parent a215a22 commit 8a92512
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Content.Server/NPC/HTN/HTNSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> planBtr, List<int> btr, ref int level)
Expand Down

0 comments on commit 8a92512

Please sign in to comment.