mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix: core:struct_air is being replaced with plants
This commit is contained in:
parent
660168391a
commit
79e8528005
1 changed files with 7 additions and 8 deletions
|
|
@ -449,14 +449,17 @@ void WorldGenerator::generate(voxel* voxels, int chunkX, int chunkZ) {
|
|||
generatePlacements(prototype, voxels, chunkX, chunkZ);
|
||||
generatePlants(prototype, values, voxels, chunkX, chunkZ, biomes);
|
||||
|
||||
#ifndef NDEBUG
|
||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
||||
blockid_t id = voxels[i].id;
|
||||
blockid_t& id = voxels[i].id;
|
||||
if (id == BLOCK_STRUCT_AIR) {
|
||||
id = BLOCK_AIR;
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
if (indices.get(id) == nullptr) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void WorldGenerator::generatePlacements(
|
||||
|
|
@ -514,11 +517,7 @@ void WorldGenerator::generateStructure(
|
|||
const auto& structVoxel =
|
||||
structVoxels[vox_index(x, y, z, size.x, size.z)];
|
||||
if (structVoxel.id) {
|
||||
if (structVoxel.id == BLOCK_STRUCT_AIR) {
|
||||
voxels[vox_index(sx, sy, sz)] = {0, {}};
|
||||
} else {
|
||||
voxels[vox_index(sx, sy, sz)] = structVoxel;
|
||||
}
|
||||
voxels[vox_index(sx, sy, sz)] = structVoxel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue