summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2012-01-02 19:47:52 +0000
committersmatz <smatz@openttd.org>2012-01-02 19:47:52 +0000
commit3655d5105b8cec5b3a2de711b8da66f8ed83a085 (patch)
tree4fb6bae1b9548140761c119081bb8a605c123cc2
parent2d368a37b99779e7e0c900442bc768c1c6148f17 (diff)
downloadopenttd-3655d5105b8cec5b3a2de711b8da66f8ed83a085.tar.xz
(svn r23716) -Revert (r23705)[FS#4937]: unforeseen consequences
-rw-r--r--src/station_cmd.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 329dcfb3a..2086f3150 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3407,19 +3407,12 @@ void FindStationsAroundTiles(const TileArea &location, StationList *stations)
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;