summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 664af247c..9bc18c759 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2759,14 +2759,16 @@ void BuildOilRig(TileIndex tile)
DEBUG(misc, 0, "Can't allocate station for oilrig at 0x%X, reverting to oilrig only", tile);
return;
}
+
+ st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->sign.width_1 = 0;
+
if (!GenerateStationName(st, tile, STATIONNAMING_OILRIG)) {
DEBUG(misc, 0, "Can't allocate station-name for oilrig at 0x%X, reverting to oilrig only", tile);
+ delete st;
return;
}
- st->town = ClosestTownFromTile(tile, (uint)-1);
- st->sign.width_1 = 0;
-
MakeOilrig(tile, st->index);
st->owner = OWNER_NONE;