diff options
| author | mat <git@matdoes.dev> | 2025-10-12 10:08:13 -1030 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-10-12 10:08:13 -1030 |
| commit | 51198a48ed0797ae80a35d6f3540cf6285ec52d8 (patch) | |
| tree | 367090ce08434c270b84eb0341e9310996920597 | |
| parent | d5e14c81810952b6d1b11b915d9c22d2119dd61f (diff) | |
| download | azalea-drasl-51198a48ed0797ae80a35d6f3540cf6285ec52d8.tar.xz | |
fix pathfinder repeatedly rotating when descending sometimes
| -rw-r--r-- | azalea/src/pathfinder/moves/basic.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs index 270dc102..539d989d 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -311,7 +311,9 @@ fn execute_descend_move(mut ctx: ExecuteCtx) { start_center.z + (center.z - start_center.z) * 1.5, ); - if player_pos_to_block_pos(position) != target || horizontal_distance_from_target > 0.25 { + if (BlockPos::from(position).horizontal_distance_squared_to(target) > 0) + || horizontal_distance_from_target > 0.25 + { if horizontal_distance_from_start < 1.25 { // this basically just exists to avoid doing spins while we're falling ctx.look_at(dest_ahead); |
