mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
randomize rotatable plants in world generation
This commit is contained in:
parent
721286c2ba
commit
0649419485
3 changed files with 12 additions and 3 deletions
|
|
@ -389,7 +389,12 @@ void WorldGenerator::generatePlants(
|
|||
}
|
||||
auto& groundVoxel = voxels[vox_index(x, height, z)];
|
||||
if (indices.get(groundVoxel.id)->rt.solid) {
|
||||
const auto& def = indices.require(plant);
|
||||
voxel = {plant, {}};
|
||||
if (def.rotatable && def.rotations.variantsCount) {
|
||||
voxel.state.rotation =
|
||||
plantsRand.rand() % def.rotations.variantsCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue