fix
This commit is contained in:
@@ -313,10 +313,15 @@ pub fn prepare_paths(
|
||||
tilemap: Res<TileMap>,
|
||||
chunk_map: Res<ChunkMap>,
|
||||
) {
|
||||
let mut paths_needed = 0;
|
||||
let mut paths_computed = 0;
|
||||
|
||||
for (entity, mut ambulatory, transform) in query.iter_mut() {
|
||||
if ambulatory.current_path.is_some() || ambulatory.target.is_none() {
|
||||
continue;
|
||||
}
|
||||
paths_needed += 1;
|
||||
|
||||
let Some(target) = ambulatory.target else {
|
||||
continue;
|
||||
};
|
||||
@@ -332,6 +337,7 @@ pub fn prepare_paths(
|
||||
let path = calculate_path_benchmarked(&tilemap, start, goal);
|
||||
ambulatory.current_path = Some(path);
|
||||
ambulatory.path_index = 0;
|
||||
paths_computed += 1;
|
||||
} else if chunk_distance > PATHFINDER_HIERARCHICAL_THRESHOLD_CHUNKS {
|
||||
let chunk_path = calculate_chunk_path(&chunk_map, start_chunk, goal_chunk);
|
||||
let provisional_goal = goal;
|
||||
|
||||
Reference in New Issue
Block a user