fix rare grass-only chunk meshes

This commit is contained in:
MihailRis
2024-10-24 09:19:58 +03:00
parent eb400e68ca
commit cbbc04edcf
3 changed files with 15 additions and 1 deletions
+7
View File
@@ -520,6 +520,13 @@ void BlocksRenderer::build(const Chunk* chunk, const ChunksStorage* chunks) {
overflow = false;
vertexOffset = 0;
indexOffset = indexSize = 0;
if (voxelsBuffer->pickBlockId(
chunk->x * CHUNK_W, 0, chunk->z * CHUNK_D
) == BLOCK_VOID) {
cancelled = true;
return;
}
cancelled = false;
const voxel* voxels = chunk->voxels;
render(voxels);
}