diff options
| author | void_17 <61356189+void2012@users.noreply.github.com> | 2026-03-06 02:11:18 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 02:11:18 +0700 |
| commit | 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch) | |
| tree | 953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/StructurePiece.cpp | |
| parent | 7d6658fe5b3095f35093701b5ab669ffc291e875 (diff) | |
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/StructurePiece.cpp')
| -rw-r--r-- | Minecraft.World/StructurePiece.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Minecraft.World/StructurePiece.cpp b/Minecraft.World/StructurePiece.cpp index cd483a6e..85a19ab4 100644 --- a/Minecraft.World/StructurePiece.cpp +++ b/Minecraft.World/StructurePiece.cpp @@ -14,7 +14,7 @@ #include "DoorItem.h" /** -* +* * A structure piece is a construction or room, located somewhere in the world * with a given orientatino (out of Direction.java). Structure pieces have a * bounding box that says where the piece is located and its bounds, and the @@ -113,10 +113,9 @@ bool StructurePiece::isInChunk( ChunkPos* pos ) StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pieces, BoundingBox* box ) { - for ( AUTO_VAR(it, pieces->begin()); it != pieces->end(); it++ ) + for (auto& piece : *pieces) { - StructurePiece* piece = *it; - if ( piece->getBoundingBox() != NULL && piece->getBoundingBox()->intersects( box ) ) + if ( piece && piece->getBoundingBox() && piece->getBoundingBox()->intersects( box ) ) { return piece; } @@ -125,7 +124,7 @@ StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pie } // 4J-PB - Added from 1.2.3 -TilePos *StructurePiece::getLocatorPosition() +TilePos *StructurePiece::getLocatorPosition() { return new TilePos(boundingBox->getXCenter(), boundingBox->getYCenter(), boundingBox->getZCenter()); } @@ -559,7 +558,7 @@ void StructurePiece::placeBlock( Level* level, int block, int data, int x, int y * The purpose of this method is to wrap the getTile call on Level, in order * to prevent the level from generating chunks that shouldn't be loaded yet. * Returns 0 if the call is out of bounds. -* +* * @param level * @param x * @param y |
