From 73c525985cd7a8e4cc01f795921ea3b7edffe9e4 Mon Sep 17 00:00:00 2001 From: hal8174 Date: Tue, 27 Feb 2024 22:43:52 +0100 Subject: [PATCH] Fix bugs. --- src/belt_finding/conflict_avoidance.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/belt_finding/conflict_avoidance.rs b/src/belt_finding/conflict_avoidance.rs index 433283b..c24b05a 100644 --- a/src/belt_finding/conflict_avoidance.rs +++ b/src/belt_finding/conflict_avoidance.rs @@ -119,7 +119,7 @@ impl ConflictAvoidance { } for path in &self.belts { - for p in &path[1..path.len() - 1] { + for p in &path[1..] { match p { PathField::Belt { pos, dir: _ } => { *conflicts.get_mut(pos.x as usize, pos.y as usize) += 1 @@ -440,7 +440,7 @@ impl ConflictAvoidance { } for path in &self.belts { - for p in &path[1..path.len() - 1] { + for p in &path[1..] { match p { PathField::Belt { pos, dir: _ } => { *conflicts.get_mut(pos.x as usize, pos.y as usize) += 1