mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-19 01:18:11 +00:00
refactor: replace NULL with nullptr across C++ codebase
Excludes vendored C libs (zlib, Miles, DirectXMath, boost, Iggy).
This commit is contained in:
@@ -81,7 +81,7 @@ void BaseRailTile::Rail::removeSoftConnections() {
|
||||
if (m_bValidRail) {
|
||||
for (unsigned int i = 0; i < connections.size(); i++) {
|
||||
Rail* rail = getRail(connections[i]);
|
||||
if (rail == NULL || !rail->connectsTo(this)) {
|
||||
if (rail == nullptr || !rail->connectsTo(this)) {
|
||||
delete connections[i];
|
||||
connections.erase(connections.begin() + i);
|
||||
i--;
|
||||
@@ -105,14 +105,14 @@ bool BaseRailTile::Rail::hasRail(int x, int y, int z) {
|
||||
}
|
||||
|
||||
BaseRailTile::Rail* BaseRailTile::Rail::getRail(TilePos* p) {
|
||||
if (!m_bValidRail) return NULL;
|
||||
if (!m_bValidRail) return nullptr;
|
||||
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 NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool BaseRailTile::Rail::connectsTo(Rail* rail) {
|
||||
@@ -213,7 +213,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 == NULL) return false;
|
||||
if (neighbor == nullptr) return false;
|
||||
neighbor->removeSoftConnections();
|
||||
bool retval = neighbor->canConnectTo(this);
|
||||
delete neighbor;
|
||||
@@ -281,7 +281,7 @@ void BaseRailTile::Rail::place(bool hasSignal, bool first) {
|
||||
AUTO_VAR(itEnd, connections.end());
|
||||
for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) {
|
||||
Rail* neighbor = getRail(*it);
|
||||
if (neighbor == NULL) continue;
|
||||
if (neighbor == nullptr) continue;
|
||||
neighbor->removeSoftConnections();
|
||||
|
||||
if (neighbor->canConnectTo(this)) {
|
||||
@@ -307,7 +307,7 @@ BaseRailTile::BaseRailTile(int id, bool usesDataBit)
|
||||
this->usesDataBit = usesDataBit;
|
||||
setShape(0, 0, 0, 1, 2 / 16.0f, 1);
|
||||
|
||||
iconTurn = NULL;
|
||||
iconTurn = nullptr;
|
||||
}
|
||||
|
||||
bool BaseRailTile::isUsesDataBit() { return usesDataBit; }
|
||||
|
||||
Reference in New Issue
Block a user