From f78568656ffe39f7cc4db293570e29900cffc6f2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 11 Aug 2024 18:48:31 +0200 Subject: find path with distance --- server/bot/src/pathfinding.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/bot/src') diff --git a/server/bot/src/pathfinding.rs b/server/bot/src/pathfinding.rs index 87ccf391..d0c6c8ef 100644 --- a/server/bot/src/pathfinding.rs +++ b/server/bot/src/pathfinding.rs @@ -42,7 +42,12 @@ impl Path { } } -pub fn find_path(walkable: &HashSet, from: IVec2, to: IVec2) -> Option { +pub fn find_path( + walkable: &HashSet, + from: IVec2, + to: IVec2, + dist_squared: i32, +) -> Option { #[derive(Debug, PartialEq, Eq)] struct Open(i32, IVec2, IVec2, i32); impl PartialOrd for Open { @@ -66,7 +71,7 @@ pub fn find_path(walkable: &HashSet, from: IVec2, to: IVec2) -> Option