From 069b61be6d132bc2d9935bb1f846da4dc3d8b5d5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 14 Jul 2024 11:32:02 +0200 Subject: fix pathfinding --- server/src/customer/pathfinding.rs | 25 +++++++++++++++---------- server/src/lib.rs | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'server/src') diff --git a/server/src/customer/pathfinding.rs b/server/src/customer/pathfinding.rs index 2fe938a9..2b9f98f4 100644 --- a/server/src/customer/pathfinding.rs +++ b/server/src/customer/pathfinding.rs @@ -57,7 +57,7 @@ impl Path { pub fn find_path(walkable: &HashSet, from: IVec2, to: IVec2) -> Option { #[derive(Debug, PartialEq, Eq)] - struct Open(i32, IVec2, IVec2); + struct Open(i32, IVec2, IVec2, i32); impl PartialOrd for Open { fn partial_cmp(&self, other: &Self) -> Option { self.0.partial_cmp(&other.0) @@ -71,23 +71,28 @@ pub fn find_path(walkable: &HashSet, from: IVec2, to: IVec2) -> Option. */ -#![feature(if_let_guard, map_many_mut, let_chains, iterator_try_collect)] +#![feature(if_let_guard, map_many_mut, let_chains, iterator_try_collect, isqrt)] pub mod customer; pub mod data; pub mod entity; -- cgit v1.2.3-70-g09d2