# HG changeset patch # User smatz # Date 1209425663 0 # Node ID 89357fea3428ebc0805f7e0ff9b1488d3acda612 # Parent 899ed5c4ce9b78bf75e5469de63251e6614a1554 (svn r12915) -Fix [FS#1960](r12857): don't initialize Station struct with tile=0, buoys will never change that value diff -r 899ed5c4ce9b -r 89357fea3428 src/station_cmd.cpp --- a/src/station_cmd.cpp Mon Apr 28 11:15:13 2008 +0000 +++ b/src/station_cmd.cpp Mon Apr 28 23:34:23 2008 +0000 @@ -951,7 +951,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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);