summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/station.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 6f10806a4..b211c6422 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -108,7 +108,7 @@ Station::~Station()
for (CargoID c = 0; c < NUM_CARGO; ++c) {
LinkGraph *lg = LinkGraph::GetIfValid(this->goods[c].link_graph);
- if (lg == NULL) continue;
+ if (lg == nullptr) continue;
for (NodeID node = 0; node < lg->Size(); ++node) {
Station *st = Station::Get((*lg)[node].Station());
@@ -187,7 +187,7 @@ RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const
{
RoadStop *rs = this->GetPrimaryRoadStop(v->IsBus() ? ROADSTOP_BUS : ROADSTOP_TRUCK);
- for (; rs != NULL; rs = rs->next) {
+ for (; rs != nullptr; rs = rs->next) {
/* The vehicle cannot go to this roadstop (different roadtype) */
if ((GetRoadTypes(rs->xy) & v->compatible_roadtypes) == ROADTYPES_NONE) continue;
/* The vehicle is articulated and can therefore not go to a standard road stop. */
@@ -326,13 +326,13 @@ uint Station::GetCatchmentRadius() const
uint ret = CA_NONE;
if (_settings_game.station.modified_catchment) {
- if (this->bus_stops != NULL) ret = max<uint>(ret, CA_BUS);
- if (this->truck_stops != NULL) ret = max<uint>(ret, CA_TRUCK);
+ if (this->bus_stops != nullptr) ret = max<uint>(ret, CA_BUS);
+ if (this->truck_stops != nullptr) ret = max<uint>(ret, CA_TRUCK);
if (this->train_station.tile != INVALID_TILE) ret = max<uint>(ret, CA_TRAIN);
if (this->dock_tile != INVALID_TILE) ret = max<uint>(ret, CA_DOCK);
if (this->airport.tile != INVALID_TILE) ret = max<uint>(ret, this->airport.GetSpec()->catchment);
} else {
- if (this->bus_stops != NULL || this->truck_stops != NULL || this->train_station.tile != INVALID_TILE || this->dock_tile != INVALID_TILE || this->airport.tile != INVALID_TILE) {
+ if (this->bus_stops != nullptr || this->truck_stops != nullptr || this->train_station.tile != INVALID_TILE || this->dock_tile != INVALID_TILE || this->airport.tile != INVALID_TILE) {
ret = CA_UNMODIFIED;
}
}
@@ -423,7 +423,7 @@ void Station::RecomputeCatchment()
}
this->catchment_tiles.Initialize(GetCatchmentRect());
- if (!_settings_game.station.serve_neutral_industries && this->industry != NULL) {
+ if (!_settings_game.station.serve_neutral_industries && this->industry != nullptr) {
/* Station is associated with an industry, so we only need to deliver to that industry. */
TILE_AREA_LOOP(tile, this->industry->location) {
if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == this->industry->index) {
@@ -464,7 +464,7 @@ void Station::RecomputeCatchment()
Industry *i = Industry::GetByTile(tile);
/* Ignore industry if it has a neutral station. It already can't be this station. */
- if (!_settings_game.station.serve_neutral_industries && i->neutral_station != NULL) continue;
+ if (!_settings_game.station.serve_neutral_industries && i->neutral_station != nullptr) continue;
i->stations_near.insert(this);