diff --git a/src/entities/shared_systems/pathfinding.rs b/src/entities/shared_systems/pathfinding.rs index b16eda0..f5099b2 100644 --- a/src/entities/shared_systems/pathfinding.rs +++ b/src/entities/shared_systems/pathfinding.rs @@ -81,7 +81,7 @@ use crate::world::{ use crate::{constants::*, entities::shared_components::Ambulatory}; use bevy::math::ivec3; use bevy_rand::prelude::*; -use rand::RngExt; +use rand::{RngExt, SeedableRng}; thread_local! { static LOCAL_PATH_TIMES: RefCell> = const { RefCell::new(Vec::new()) }; @@ -236,6 +236,7 @@ impl Plugin for PathfindingPlugin { collect_pathfinding_dirty_chunks, invalidate_paths_on_tile_change, crate::entities::tasks::task_executor_system, + update_wandering_targets, prepare_paths, movement, ) @@ -529,14 +530,19 @@ pub fn merge_benchmark_stats(mut bench: ResMut) { } pub fn update_wandering_targets( - mut query: Query<(&mut Ambulatory, &Transform)>, + mut query: Query<(&mut Ambulatory, &Transform), Without>, tilemap: Res, chunk_map: Res, - mut rng_q: Query<&mut WyRand, With>, + time: Res