Mercurial > hg > openttd
changeset 18867:d0f149429a29 draft
(svn r23716) -Revert (r23705)[FS#4937]: unforeseen consequences
author | smatz <smatz@openttd.org> |
---|---|
date | Mon, 02 Jan 2012 19:47:52 +0000 |
parents | c50cedc07261 |
children | 5b6feffee0c6 |
files | src/station_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3407,19 +3407,12 @@ if (max_x >= MapSizeX()) max_x = MapSizeX() - 1; if (max_y >= MapSizeY()) max_y = MapSizeY() - 1; - StationID last = INVALID_STATION; - for (uint cy = min_y; cy < max_y; cy++) { for (uint cx = min_x; cx < max_x; cx++) { TileIndex cur_tile = TileXY(cx, cy); if (!IsTileType(cur_tile, MP_STATION)) continue; - StationID sid = GetStationIndex(cur_tile); - /* Stop early if we met the same station again. */ - if (sid == last) continue; - last = sid; - - Station *st = Station::GetIfValid(sid); + Station *st = Station::GetByTile(cur_tile); /* st can be NULL in case of waypoints */ if (st == NULL) continue;