fix: core:struct_air is being replaced with plants
This commit is contained in:
@@ -449,14 +449,17 @@ void WorldGenerator::generate(voxel* voxels, int chunkX, int chunkZ) {
|
|||||||
generatePlacements(prototype, voxels, chunkX, chunkZ);
|
generatePlacements(prototype, voxels, chunkX, chunkZ);
|
||||||
generatePlants(prototype, values, voxels, chunkX, chunkZ, biomes);
|
generatePlants(prototype, values, voxels, chunkX, chunkZ, biomes);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
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) {
|
if (indices.get(id) == nullptr) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::generatePlacements(
|
void WorldGenerator::generatePlacements(
|
||||||
@@ -514,11 +517,7 @@ void WorldGenerator::generateStructure(
|
|||||||
const auto& structVoxel =
|
const auto& structVoxel =
|
||||||
structVoxels[vox_index(x, y, z, size.x, size.z)];
|
structVoxels[vox_index(x, y, z, size.x, size.z)];
|
||||||
if (structVoxel.id) {
|
if (structVoxel.id) {
|
||||||
if (structVoxel.id == BLOCK_STRUCT_AIR) {
|
voxels[vox_index(sx, sy, sz)] = structVoxel;
|
||||||
voxels[vox_index(sx, sy, sz)] = {0, {}};
|
|
||||||
} else {
|
|
||||||
voxels[vox_index(sx, sy, sz)] = structVoxel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user