aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-30 00:02:36 +0500
committermat <git@matdoes.dev>2026-01-30 00:02:36 +0500
commit6c0be6913dd0bcbb7e17a3e2a4daa45fcc8f5103 (patch)
tree6e09534e5f9119da4bf0712560bde892b49b5384 /azalea/src/pathfinder
parentb0d0bd17f5978abb4e69ce5391622799e2185992 (diff)
downloadazalea-drasl-6c0be6913dd0bcbb7e17a3e2a4daa45fcc8f5103.tar.xz
warn if pathfinder is running without optimizations, and other minor fixes
Diffstat (limited to 'azalea/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/mod.rs12
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) {