# HG changeset patch # User yexo # Date 1299180378 0 # Node ID 1b0094757e186e3fdaf904d1cb9242c4a9f1c74a # Parent 74d340e6542d96e547ca1d2859231337bd80ab51 (svn r22163) -Fix [FS#4541]: building a station part adjacent to both an existing station and a rail waypoint failed diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -92,9 +92,10 @@ TILE_AREA_LOOP(tile_cur, ta) { if (IsTileType(tile_cur, MP_STATION)) { StationID t = GetStationIndex(tile_cur); + if (!T::IsValidID(t)) continue; if (closest_station == INVALID_STATION) { - if (T::IsValidID(t)) closest_station = t; + closest_station = t; } else if (closest_station != t) { return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING); }