mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
(svn r23716) -Revert (r23705)[FS#4937]: unforeseen consequences
This commit is contained in:
parent
2d368a37b9
commit
3655d5105b
@ -3407,19 +3407,12 @@ void FindStationsAroundTiles(const TileArea &location, StationList *stations)
|
|||||||
if (max_x >= MapSizeX()) max_x = MapSizeX() - 1;
|
if (max_x >= MapSizeX()) max_x = MapSizeX() - 1;
|
||||||
if (max_y >= MapSizeY()) max_y = MapSizeY() - 1;
|
if (max_y >= MapSizeY()) max_y = MapSizeY() - 1;
|
||||||
|
|
||||||
StationID last = INVALID_STATION;
|
|
||||||
|
|
||||||
for (uint cy = min_y; cy < max_y; cy++) {
|
for (uint cy = min_y; cy < max_y; cy++) {
|
||||||
for (uint cx = min_x; cx < max_x; cx++) {
|
for (uint cx = min_x; cx < max_x; cx++) {
|
||||||
TileIndex cur_tile = TileXY(cx, cy);
|
TileIndex cur_tile = TileXY(cx, cy);
|
||||||
if (!IsTileType(cur_tile, MP_STATION)) continue;
|
if (!IsTileType(cur_tile, MP_STATION)) continue;
|
||||||
|
|
||||||
StationID sid = GetStationIndex(cur_tile);
|
Station *st = Station::GetByTile(cur_tile);
|
||||||
/* Stop early if we met the same station again. */
|
|
||||||
if (sid == last) continue;
|
|
||||||
last = sid;
|
|
||||||
|
|
||||||
Station *st = Station::GetIfValid(sid);
|
|
||||||
/* st can be NULL in case of waypoints */
|
/* st can be NULL in case of waypoints */
|
||||||
if (st == NULL) continue;
|
if (st == NULL) continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user