make world generator less pedantic in structures placement
This commit is contained in:
@@ -162,9 +162,11 @@ void WorldGenerator::placeStructure(
|
|||||||
AABB aabb(position, position + size);
|
AABB aabb(position, position + size);
|
||||||
for (int lcz = -1; lcz <= 1; lcz++) {
|
for (int lcz = -1; lcz <= 1; lcz++) {
|
||||||
for (int lcx = -1; lcx <= 1; lcx++) {
|
for (int lcx = -1; lcx <= 1; lcx++) {
|
||||||
auto& otherPrototype = requirePrototype(
|
const auto& found = prototypes.find({chunkX + lcx, chunkZ + lcz});
|
||||||
chunkX + lcx, chunkZ + lcz
|
if (found == prototypes.end()) {
|
||||||
);
|
continue;
|
||||||
|
}
|
||||||
|
auto& otherPrototype = *found->second;
|
||||||
auto chunkAABB = gen_chunk_aabb(chunkX + lcx, chunkZ + lcz);
|
auto chunkAABB = gen_chunk_aabb(chunkX + lcx, chunkZ + lcz);
|
||||||
if (chunkAABB.intersect(aabb)) {
|
if (chunkAABB.intersect(aabb)) {
|
||||||
otherPrototype.placements.emplace_back(
|
otherPrototype.placements.emplace_back(
|
||||||
|
|||||||
Reference in New Issue
Block a user