aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/BaseRailTile.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/BaseRailTile.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/BaseRailTile.cpp')
-rw-r--r--Minecraft.World/BaseRailTile.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/BaseRailTile.cpp b/Minecraft.World/BaseRailTile.cpp
index 0494e266..db854bb3 100644
--- a/Minecraft.World/BaseRailTile.cpp
+++ b/Minecraft.World/BaseRailTile.cpp
@@ -19,7 +19,7 @@ BaseRailTile::Rail::Rail(Level *level, int x, int y, int z)
if(m_bValidRail)
{
int direction = level->getData(x, y, z);
- if (static_cast<BaseRailTile *>(Tile::tiles[id])->usesDataBit)
+ if (((BaseRailTile *) Tile::tiles[id])->usesDataBit)
{
usesDataBit = true;
direction = direction & ~RAIL_DATA_BIT;
@@ -34,7 +34,7 @@ BaseRailTile::Rail::Rail(Level *level, int x, int y, int z)
BaseRailTile::Rail::~Rail()
{
- for( size_t i = 0; i < connections.size(); i++ )
+ for( int i = 0; i < connections.size(); i++ )
{
delete connections[i];
}
@@ -44,7 +44,7 @@ void BaseRailTile::Rail::updateConnections(int direction)
{
if(m_bValidRail)
{
- for( size_t i = 0; i < connections.size(); i++ )
+ for( int i = 0; i < connections.size(); i++ )
{
delete connections[i];
}
@@ -102,7 +102,7 @@ void BaseRailTile::Rail::removeSoftConnections()
for (unsigned int i = 0; i < connections.size(); i++)
{
Rail *rail = getRail(connections[i]);
- if (rail == nullptr || !rail->connectsTo(this))
+ if (rail == NULL || !rail->connectsTo(this))
{
delete connections[i];
connections.erase(connections.begin()+i);
@@ -130,11 +130,11 @@ bool BaseRailTile::Rail::hasRail(int x, int y, int z)
BaseRailTile::Rail *BaseRailTile::Rail::getRail(TilePos *p)
{
- if(!m_bValidRail) return nullptr;
+ if(!m_bValidRail) return NULL;
if (isRail(level, p->x, p->y, p->z)) return new Rail(level, p->x, p->y, p->z);
if (isRail(level, p->x, p->y + 1, p->z)) return new Rail(level, p->x, p->y + 1, p->z);
if (isRail(level, p->x, p->y - 1, p->z)) return new Rail(level, p->x, p->y - 1, p->z);
- return nullptr;
+ return NULL;
}
@@ -253,7 +253,7 @@ bool BaseRailTile::Rail::hasNeighborRail(int x, int y, int z)
if(!m_bValidRail) return false;
TilePos tp(x,y,z);
Rail *neighbor = getRail( &tp );
- if (neighbor == nullptr) return false;
+ if (neighbor == NULL) return false;
neighbor->removeSoftConnections();
bool retval = neighbor->canConnectTo(this);
delete neighbor;
@@ -331,7 +331,7 @@ void BaseRailTile::Rail::place(bool hasSignal, bool first)
for ( auto& it : connections )
{
Rail *neighbor = getRail(it);
- if (neighbor == nullptr) continue;
+ if (neighbor == NULL) continue;
neighbor->removeSoftConnections();
if (neighbor->canConnectTo(this))
@@ -359,7 +359,7 @@ BaseRailTile::BaseRailTile(int id, bool usesDataBit) : Tile(id, Material::decora
this->usesDataBit = usesDataBit;
setShape(0, 0, 0, 1, 2 / 16.0f, 1);
- iconTurn = nullptr;
+ iconTurn = NULL;
}
bool BaseRailTile::isUsesDataBit()
@@ -369,7 +369,7 @@ bool BaseRailTile::isUsesDataBit()
AABB *BaseRailTile::getAABB(Level *level, int x, int y, int z)
{
- return nullptr;
+ return NULL;
}
bool BaseRailTile::blocksLight()