minor optimization

This commit is contained in:
MihailRis 2025-12-07 18:27:12 +03:00
parent 43ec32662c
commit 677b7c67de

View file

@ -151,8 +151,12 @@ void BlocksController::randomTick(
for (int s = 0; s < segments; s++) {
for (int i = 0; i < 4; i++) {
int segmentY = s * segheight;
if (segmentY > chunk.top) {
break;
}
int bx = random.rand() % CHUNK_W;
int by = random.rand() % segheight + s * segheight;
int by = random.rand() % segheight + segmentY;
int bz = random.rand() % CHUNK_D;
const voxel& vox = chunk.voxels[vox_index(bx, by, bz)];
auto& block = indices->blocks.require(vox.id);