1
Fork 0

logic error removal (partial)

This commit is contained in:
Andy Killorin 2023-12-25 15:42:47 -06:00
parent 9d7f3f45d5
commit 36cdf9387f
Signed by: ank
GPG key ID: B6241CA3B552BCA4
2 changed files with 6 additions and 4 deletions

View file

@ -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;
}
}

View file

@ -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)