From 36cdf9387f8c4f9b2150dc6ed1a4cf7f90184b24 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:42:47 -0600 Subject: [PATCH] logic error removal (partial) --- server/src/mine.rs | 6 +++--- server/src/paths.rs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/mine.rs b/server/src/mine.rs index d75b46c..72aff8d 100644 --- a/server/src/mine.rs +++ b/server/src/mine.rs @@ -258,14 +258,14 @@ impl Quarry { async fn mark_done(&self, chunk: i32) { let mut in_flight = self.in_flight.write().await; - let min = in_flight.iter().min() == Some(&chunk); + let min = in_flight.iter().max() == Some(&chunk); in_flight.retain(|c| c != &chunk); if min { // make sure that head is no less than min loop { - let curr = self.head.load(Ordering::SeqCst); - if let Ok(_) = self.head.compare_exchange(curr, curr.min(chunk), Ordering::AcqRel, Ordering::SeqCst) { + let curr = self.confirmed.load(Ordering::SeqCst); + if let Ok(_) = self.confirmed.compare_exchange(curr, curr.max(chunk), Ordering::AcqRel, Ordering::SeqCst) { break; } } diff --git a/server/src/paths.rs b/server/src/paths.rs index a91d5d6..0c136d0 100644 --- a/server/src/paths.rs +++ b/server/src/paths.rs @@ -101,7 +101,7 @@ pub const TRANSPARENT: [&str; 3] = [ ]; /// Blocks that are fine to tunnel through -const GARBAGE: [&str; 11] = [ +const GARBAGE: [&str; 13] = [ "minecraft:stone", "minecraft:dirt", "minecraft:andesite", @@ -113,6 +113,8 @@ const GARBAGE: [&str; 11] = [ "minecraft:spruce_leaves", "minecraft:oak_leaves", "traverse:fir_leaves", + "wilderwild:brown_shelf_fungus", + "wilderwild:red_shelf_fungus", ]; /// time taken to go through uncharted territory (in turtle. calls)