Remove AUTO_VAR macro and _toString function (#592)

This commit is contained in:
void_17
2026-03-06 02:11:18 +07:00
committed by GitHub
parent 7d6658fe5b
commit 55231bb8d3
294 changed files with 5067 additions and 5773 deletions

View File

@@ -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