fixed invalid y loop

master
Martin Gerhardy 2016-03-30 17:35:40 +02:00
parent f74f295502
commit 147602cb9a
1 changed files with 4 additions and 3 deletions

View File

@ -241,10 +241,11 @@ void World::addTree(const PolyVox::Region& region, WorldData::Chunk* chunk, cons
if ((x >= pos.x + trunkWidthY || x < pos.x - trunkWidthY) && (z >= pos.z + trunkWidthY || z < pos.z - trunkWidthY)) {
continue;
}
if (y == pos.y) {
y = findChunkFloor(chunkHeight, chunk, x, z);
int y1 = y;
if (y1 == pos.y) {
y1 = findChunkFloor(chunkHeight, chunk, x, z);
}
chunk->setVoxel(x, y, z, voxel);
chunk->setVoxel(x, y1, z, voxel);
}
}
}