diff options
Diffstat (limited to 'azalea/src/pathfinder')
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 8df04b14..6f1a0d8a 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -32,7 +32,7 @@ use std::{ collections::VecDeque, sync::{ Arc, - atomic::{self, AtomicUsize}, + atomic::{self, AtomicBool, AtomicUsize}, }, thread, time::{Duration, Instant}, @@ -306,6 +306,16 @@ pub fn goto_listener( continue; }; + // this env variable is set from the build.rs + if env!("OPT_LEVEL") == "0" { + static WARNED: AtomicBool = AtomicBool::new(false); + if !WARNED.swap(true, atomic::Ordering::Relaxed) { + warn!( + "Azalea was compiled with no optimizations, which may result in significantly reduced pathfinding performance. Consider following the steps at https://azalea.matdoes.dev/azalea/#optimization for faster performance in debug mode." + ) + } + } + let cur_pos = player_pos_to_block_pos(**position); if event.goal.success(cur_pos) { |
