aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StructureStart.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-05 17:17:45 -0600
committerGitHub <noreply@github.com>2026-03-05 17:17:45 -0600
commit0666959d312dc74903f55d1071488a90239330f1 (patch)
tree5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/StructureStart.cpp
parent9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff)
parenteed770b121aa4ce38f002db042d0137c24c6d344 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/StructureStart.cpp')
-rw-r--r--Minecraft.World/StructureStart.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/Minecraft.World/StructureStart.cpp b/Minecraft.World/StructureStart.cpp
index 9e5ba0a8..3f22b4a7 100644
--- a/Minecraft.World/StructureStart.cpp
+++ b/Minecraft.World/StructureStart.cpp
@@ -21,9 +21,9 @@ StructureStart::StructureStart(int x, int z)
StructureStart::~StructureStart()
{
- for(AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ )
+ for(auto& piece : pieces)
{
- delete (*it);
+ delete piece;
}
delete boundingBox;
}
@@ -40,9 +40,9 @@ list<StructurePiece *> *StructureStart::getPieces()
void StructureStart::postProcess(Level *level, Random *random, BoundingBox *chunkBB)
{
- AUTO_VAR(it, pieces.begin());
+ auto it = pieces.begin();
- while( it != pieces.end() )
+ while( it != pieces.end() )
{
if( (*it)->getBoundingBox()->intersects(chunkBB) && !(*it)->postProcess(level, random, chunkBB))
{
@@ -61,9 +61,8 @@ void StructureStart::calculateBoundingBox()
{
boundingBox = BoundingBox::getUnknownBox();
- for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ )
+ for(auto& piece : pieces)
{
- StructurePiece *piece = *it;
boundingBox->expand(piece->getBoundingBox());
}
}
@@ -78,9 +77,8 @@ CompoundTag *StructureStart::createTag(int chunkX, int chunkZ)
tag->put(L"BB", boundingBox->createTag(L"BB"));
ListTag<CompoundTag> *childrenTags = new ListTag<CompoundTag>(L"Children");
- for(AUTO_VAR(it, pieces.begin()); it != pieces.end(); ++it)
+ for(auto& piece : pieces)
{
- StructurePiece *piece = *it;
childrenTags->add(piece->createTag());
}
tag->put(L"Children", childrenTags);
@@ -133,9 +131,8 @@ void StructureStart::moveBelowSeaLevel(Level *level, Random *random, int offset)
// move all bounding boxes
int dy = y1Pos - boundingBox->y1;
boundingBox->move(0, dy, 0);
- for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ )
+ for(auto& piece : pieces)
{
- StructurePiece *piece = *it;
piece->getBoundingBox()->move(0, dy, 0);
}
}
@@ -157,9 +154,8 @@ void StructureStart::moveInsideHeights(Level *level, Random *random, int lowestA
// move all bounding boxes
int dy = y0Pos - boundingBox->y0;
boundingBox->move(0, dy, 0);
- for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ )
+ for(auto& piece : pieces)
{
- StructurePiece *piece = *it;
piece->getBoundingBox()->move(0, dy, 0);
}
}