summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 636b1c476..3abeb8711 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -4172,6 +4172,10 @@ void DeleteOilRig(TileIndex tile)
/* The oil rig station is not supposed to be shared with anything else */
assert(st->facilities == (FACIL_AIRPORT | FACIL_DOCK) && st->airport.type == AT_OILRIG);
+ if (st->industry != nullptr && st->industry->neutral_station == st) {
+ /* Don't leave dangling neutral station pointer */
+ st->industry->neutral_station = nullptr;
+ }
delete st;
}