diff options
| author | mat <git@matdoes.dev> | 2023-09-14 22:54:08 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-09-14 22:54:08 -0500 |
| commit | 622042fd41b89d2d9721314a9d136672bf00eac7 (patch) | |
| tree | b5c33054dd157b2594d1cbe835c679e5af5ea187 /azalea/src/pathfinder/moves/basic.rs | |
| parent | e585d9024d5d1a267659c4a05b535c3ffdd81bfb (diff) | |
| download | azalea-drasl-622042fd41b89d2d9721314a9d136672bf00eac7.tar.xz | |
infinite pathfinding
Diffstat (limited to 'azalea/src/pathfinder/moves/basic.rs')
| -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 b8886c9e..a1175717 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -1,3 +1,5 @@ +use std::f32::consts::SQRT_2; + use azalea_client::{SprintDirection, StartSprintEvent}; use azalea_core::{BlockPos, CardinalDirection}; use azalea_world::Instance; @@ -183,7 +185,7 @@ fn diagonal_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { if !is_standable(&(pos + offset), world) { continue; } - let cost = SPRINT_ONE_BLOCK_COST * 1.4; + let cost = SPRINT_ONE_BLOCK_COST * SQRT_2; edges.push(Edge { movement: astar::Movement { |
