add fragment.crop, fragment:crop() & fix fragments rotation when width is not equal to depth & fix extra structures placements

This commit is contained in:
MihailRis
2024-10-15 00:03:06 +03:00
parent 44eedadc06
commit 48143c5a2b
13 changed files with 93 additions and 20 deletions
+1 -3
View File
@@ -272,9 +272,6 @@ void WorldGenerator::generateStructures(
glm::ivec3 position {x, height, z};
position.x -= structure.getSize().x / 2;
position.z -= structure.getSize().z / 2;
prototype.placements.emplace_back(
1, StructurePlacement {structureId, position, rotation}
);
placeStructure(
StructurePlacement {
structureId,
@@ -486,6 +483,7 @@ void WorldGenerator::generateStructure(
auto& structVoxels = structure.getRuntimeVoxels();
const auto& offset = placement.position;
const auto& size = structure.getSize();
for (int y = 0; y < size.y; y++) {
int sy = y + offset.y;
if (sy < 0 || sy >= CHUNK_H) {