diff options
Diffstat (limited to 'azalea/src/pathfinder/moves/basic.rs')
| -rw-r--r-- | azalea/src/pathfinder/moves/basic.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs index bb931caf..89ba9acc 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -228,9 +228,10 @@ fn execute_descend_move(mut ctx: ExecuteCtx) { let start_center = start.center(); let center = target.center(); - let horizontal_distance_from_target = (center - position).horizontal_distance_sqr().sqrt(); - let horizontal_distance_from_start = - (start.center() - position).horizontal_distance_sqr().sqrt(); + let horizontal_distance_from_target = (center - position).horizontal_distance_squared().sqrt(); + let horizontal_distance_from_start = (start.center() - position) + .horizontal_distance_squared() + .sqrt(); let dest_ahead = Vec3::new( start_center.x + (center.x - start_center.x) * 1.5, @@ -401,8 +402,9 @@ fn execute_downward_move(mut ctx: ExecuteCtx) { let target_center = target.center(); - let horizontal_distance_from_target = - (target_center - position).horizontal_distance_sqr().sqrt(); + let horizontal_distance_from_target = (target_center - position) + .horizontal_distance_squared() + .sqrt(); if horizontal_distance_from_target > 0.25 { ctx.look_at(target_center); |
