make world generator less pedantic in structures placement

This commit is contained in:
MihailRis 2024-10-14 20:47:37 +03:00
parent fd2bd15658
commit 44eedadc06

View File

@ -162,9 +162,11 @@ void WorldGenerator::placeStructure(
AABB aabb(position, position + size);
for (int lcz = -1; lcz <= 1; lcz++) {
for (int lcx = -1; lcx <= 1; lcx++) {
auto& otherPrototype = requirePrototype(
chunkX + lcx, chunkZ + lcz
);
const auto& found = prototypes.find({chunkX + lcx, chunkZ + lcz});
if (found == prototypes.end()) {
continue;
}
auto& otherPrototype = *found->second;
auto chunkAABB = gen_chunk_aabb(chunkX + lcx, chunkZ + lcz);
if (chunkAABB.intersect(aabb)) {
otherPrototype.placements.emplace_back(