summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-28 23:34:23 +0000
committersmatz <smatz@openttd.org>2008-04-28 23:34:23 +0000
commitdd00683a463f5b0022cd4bbeff8fd4515182e6ee (patch)
tree7d587c445eee086aeaf44aa3d130a8719a899ef0
parenta37ee93f8d83c298c5957358fe594ee5bf59cc5e (diff)
downloadopenttd-dd00683a463f5b0022cd4bbeff8fd4515182e6ee.tar.xz
(svn r12915) -Fix [FS#1960](r12857): don't initialize Station struct with tile=0, buoys will never change that value
-rw-r--r--src/station_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 1e73e45df..06ee48b08 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -951,7 +951,7 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
if (flags & DC_EXEC) {
- st = new Station();
+ st = new Station(tile_org);
st->town = ClosestTownFromTile(tile_org, UINT_MAX);
st->string_id = GenerateStationName(st, tile_org, STATIONNAMING_RAIL);
@@ -1375,7 +1375,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
if (flags & DC_EXEC) {
- st = new Station();
+ st = new Station(tile);
st->town = ClosestTownFromTile(tile, UINT_MAX);
st->string_id = GenerateStationName(st, tile, STATIONNAMING_ROAD);
@@ -1683,7 +1683,7 @@ CommandCost CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
if (flags & DC_EXEC) {
- st = new Station();
+ st = new Station(tile);
st->town = t;
st->string_id = GenerateStationName(st, tile, !(afc->flags & AirportFTAClass::AIRPLANES) ? STATIONNAMING_HELIPORT : STATIONNAMING_AIRPORT);
@@ -1800,7 +1800,7 @@ CommandCost CmdBuildBuoy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
if (flags & DC_EXEC) {
- Station *st = new Station();
+ Station *st = new Station(tile);
st->town = ClosestTownFromTile(tile, UINT_MAX);
st->string_id = GenerateStationName(st, tile, STATIONNAMING_BUOY);
@@ -1960,7 +1960,7 @@ CommandCost CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!Station::CanAllocateItem()) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
if (flags & DC_EXEC) {
- st = new Station();
+ st = new Station(tile);
st->town = ClosestTownFromTile(tile, UINT_MAX);
st->string_id = GenerateStationName(st, tile, STATIONNAMING_DOCK);
@@ -2794,7 +2794,7 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount)
void BuildOilRig(TileIndex tile)
{
- Station *st = new Station();
+ Station *st = new Station(tile);
if (st == NULL) {
DEBUG(misc, 0, "Can't allocate station for oilrig at 0x%X, reverting to oilrig only", tile);