randomize rotatable plants in world generation

This commit is contained in:
MihailRis
2025-02-21 19:35:37 +03:00
parent 721286c2ba
commit 0649419485
3 changed files with 12 additions and 3 deletions
+5
View File
@@ -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;
}
}
}
}