summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-04 11:46:01 +0000
committerrubidium <rubidium@openttd.org>2007-11-04 11:46:01 +0000
commit6fe2b0b3b269d6d511d97c5ad71fda746d4f50ad (patch)
tree7d1dc9812a4917a15d88a3db48a8032d6b2937c7 /src
parent91af1d6bca5139b76cab17624334bf68af5bff38 (diff)
downloadopenttd-6fe2b0b3b269d6d511d97c5ad71fda746d4f50ad.tar.xz
(svn r11376) -Fix: fill the town a oil rig is associated with before creating the name, otherwise every oil rig will become "<TOWN> Oilrig" which effectively means that there can be several oil rigs with exactly the same name.
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;