From 31c93f7926128fa69be85d54f26ce96bad96fa6f Mon Sep 17 00:00:00 2001 From: popertots Date: Wed, 18 Mar 2026 17:12:05 +0000 Subject: [PATCH] fix: remove goal standability check from provisional path The is_standable_tile(goal) check was causing failures when goal position wasn't directly standable (common case). A* doesn't require goal to be standable - it finds the best path it can. Removed the check and return fallback single-point path when start isn't standable. --- src/entities/shared_systems/pathfinding.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/entities/shared_systems/pathfinding.rs b/src/entities/shared_systems/pathfinding.rs index b657751..6e7e19a 100644 --- a/src/entities/shared_systems/pathfinding.rs +++ b/src/entities/shared_systems/pathfinding.rs @@ -585,13 +585,7 @@ pub fn calculate_provisional_path( LOCAL_FAILED_PATHS.with(|f| { *f.borrow_mut() += 1; }); - return Vec::new(); - } - if !is_standable_tile(tilemap, goal) { - LOCAL_FAILED_PATHS.with(|f| { - *f.borrow_mut() += 1; - }); - return Vec::new(); + return vec![Vec3::new(start.x as f32, start.y as f32, start.z as f32)]; } let estimated_tiles = octile_distance_3d(start, goal) / ITILE_SIZE;