mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
minor optimization
This commit is contained in:
parent
43ec32662c
commit
677b7c67de
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue