Skip to content

Commit 4cbfb01

Browse files
Update mesher
1 parent e2a2d89 commit 4cbfb01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/client/terrain/util/mesher.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ pub fn create_chunk_mesh(chunk: &Chunk, texture_manager: &TextureManager) -> Opt
8686
indices: Vec::new(),
8787
};
8888

89-
for x in 0..CHUNK_SIZE {
90-
for y in 0..CHUNK_SIZE {
91-
for z in 0..CHUNK_SIZE {
92-
let block_id = chunk.get(x, y, z);
89+
for x in 1..CHUNK_SIZE + 1 {
90+
for y in 1..CHUNK_SIZE + 1 {
91+
for z in 1..CHUNK_SIZE + 1 {
92+
let block_id = chunk.get_unpadded(x, y, z);
9393

9494
if block_id == BlockId::Air {
9595
continue;
@@ -103,7 +103,7 @@ pub fn create_chunk_mesh(chunk: &Chunk, texture_manager: &TextureManager) -> Opt
103103
y: usize,
104104
z: usize,
105105
) {
106-
if chunk.get(x, y, z) == BlockId::Air {
106+
if chunk.get_unpadded(x, y, z) == BlockId::Air {
107107
*mask |= value;
108108
}
109109
}

0 commit comments

Comments
 (0)