From ea84b43158ac5fba46e9647e3c1310d8db0b765a Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 27 Jul 2023 22:09:26 +0100 Subject: [PATCH] Fix surface voxel detection logic --- src/voxel/brickmap.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/voxel/brickmap.rs b/src/voxel/brickmap.rs index ab3ac62..0035e5e 100644 --- a/src/voxel/brickmap.rs +++ b/src/voxel/brickmap.rs @@ -422,12 +422,12 @@ impl BrickmapManager { if x == 0 || x == 7 || y == 0 || y == 7 || z == 0 || z == 7 { true } else { - !(block[idx + 1] == empty_voxel - && block[idx - 1] == empty_voxel - && block[idx + 8] == empty_voxel - && block[idx - 8] == empty_voxel - && block[idx + 64] == empty_voxel - && block[idx - 64] == empty_voxel) + center_block[idx + 1] == empty_voxel + || center_block[idx - 1] == empty_voxel + || center_block[idx + 8] == empty_voxel + || center_block[idx - 8] == empty_voxel + || center_block[idx + 64] == empty_voxel + || center_block[idx - 64] == empty_voxel }; // Set the appropriate bit in the z entry and add the