From 91fde2dbea41a07c261cd8b85ac4c851e993efc8 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 4 Jan 2026 18:40:58 +0800 Subject: return cost in pathfinder a_star function --- azalea/src/pathfinder/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'azalea/src/pathfinder/mod.rs') diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 8a6e5ef2..905a90fe 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -439,6 +439,7 @@ pub fn calculate_path(ctx: CalculatePathCtx) -> Option { let astar::Path { movements, is_partial, + cost, } = a_star( RelBlockPos::get_origin(origin), |n| ctx.goal.heuristic(n.apply(origin)), @@ -448,7 +449,7 @@ pub fn calculate_path(ctx: CalculatePathCtx) -> Option { ctx.opts.max_timeout, ); let end_time = Instant::now(); - debug!("partial: {is_partial:?}"); + debug!("partial: {is_partial:?}, cost: {cost}"); let duration = end_time - start_time; if is_partial { if movements.is_empty() { -- cgit v1.2.3