diff options
Diffstat (limited to 'server/src/entity/customers/pathfinding.rs')
-rw-r--r-- | server/src/entity/customers/pathfinding.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/src/entity/customers/pathfinding.rs b/server/src/entity/customers/pathfinding.rs index 97bd8328..87ccf391 100644 --- a/server/src/entity/customers/pathfinding.rs +++ b/server/src/entity/customers/pathfinding.rs @@ -47,7 +47,7 @@ pub fn find_path(walkable: &HashSet<IVec2>, from: IVec2, to: IVec2) -> Option<Pa struct Open(i32, IVec2, IVec2, i32); impl PartialOrd for Open { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { - self.0.partial_cmp(&other.0) + Some(self.0.cmp(&other.0)) } } impl Ord for Open { @@ -61,9 +61,7 @@ pub fn find_path(walkable: &HashSet<IVec2>, from: IVec2, to: IVec2) -> Option<Pa open.push(Open(1, from, from, 0)); loop { - let Some(Open(_, pos, f, distance)) = open.pop() else { - return None; - }; + let Open(_, pos, f, distance) = open.pop()?; if visited.contains_key(&pos) { continue; } |