fix: core:struct_air is being replaced with plants

This commit is contained in:
MihailRis 2024-10-24 13:27:32 +03:00
parent 9157012cdb
commit 2b057a0977

View File

@ -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;
}
}
}