From 5ce830ae6ce12982cdfa578673374de7444abf3f Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 8 Mar 2023 16:35:12 +0000 Subject: [PATCH] merge main --- azalea-world/src/iterators.rs | 2 +- azalea-world/src/world.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azalea-world/src/iterators.rs b/azalea-world/src/iterators.rs index 53a94898..4054bfe0 100644 --- a/azalea-world/src/iterators.rs +++ b/azalea-world/src/iterators.rs @@ -73,7 +73,7 @@ impl Iterator for BlockIterator { let x = self.pos.x * self.right; let y = self.pos.y * ((self.apothem as i32) - self.left); let z = self.pos.z * ((self.apothem as i32) - (i32::abs(x) + i32::abs(y))); - Some(BlockPos { x: x, y, z } + self.start) + Some(BlockPos { x, y, z } + self.start) } } diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index 5bb9b0b7..7da9b869 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -242,7 +242,7 @@ impl Instance { let this_block_pos = BlockPos { x, y, z }; let this_block_distance = (nearest_to - this_block_pos).length_manhattan(); // only update if it's closer - if !nearest_found_pos.is_some() + if nearest_found_pos.is_none() || this_block_distance < nearest_found_distance { nearest_found_pos = Some(this_block_pos);