summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-04-26 21:34:55 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-05-03 09:50:01 +0200
commitd1ef13fc04d378a805711dd256ff696301da1e34 (patch)
tree9e37b1d5374a1504532fd796e57ad83dcbd7d0e7
parent585c45d6c2963757d4c25a69992f3f9353daf46f (diff)
downloadopenttd-d1ef13fc04d378a805711dd256ff696301da1e34.tar.xz
Fix #7481: Just remove oil rig stations right away, don't clean them first
-rw-r--r--src/station_cmd.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 0ba824c0d..1a483d29d 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -4029,16 +4029,9 @@ void DeleteOilRig(TileIndex tile)
MakeWaterKeepingClass(tile, OWNER_NONE);
- st->dock_tile = INVALID_TILE;
- st->airport.Clear();
- st->facilities &= ~(FACIL_AIRPORT | FACIL_DOCK);
- st->airport.flags = 0;
-
- st->rect.AfterRemoveTile(st, tile);
-
- st->UpdateVirtCoord();
- st->RecomputeCatchment();
- if (!st->IsInUse()) delete st;
+ /* 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);
+ delete st;
}
static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_owner)