changeset 17414:1b0094757e18 draft

(svn r22163) -Fix [FS#4541]: building a station part adjacent to both an existing station and a rail waypoint failed
author yexo <yexo@openttd.org>
date Thu, 03 Mar 2011 19:26:18 +0000
parents 74d340e6542d
children 5de4eeca544a
files src/station_cmd.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
 			}