mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
make world generator less pedantic in structures placement
This commit is contained in:
parent
fd2bd15658
commit
44eedadc06
1 changed files with 5 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue