(svn r16926) -Fix (r16925): if checking whether a station can be adjoined, don't check whether 'the other station you have already found' to be valid but the station that you just found. Especially because you won't have found as station until you have found one.

This commit is contained in:
rubidium
2009-07-23 12:13:53 +00:00
parent 7f08aa4572
commit b717e32dcc

View File

@@ -81,7 +81,7 @@ static Station *GetStationAround(TileIndex tile, int w, int h, StationID closest
StationID t = GetStationIndex(tile_cur); StationID t = GetStationIndex(tile_cur);
if (closest_station == INVALID_STATION) { if (closest_station == INVALID_STATION) {
if (Station::IsValidID(closest_station)) closest_station = t; if (Station::IsValidID(t)) closest_station = t;
} else if (closest_station != t) { } else if (closest_station != t) {
_error_message = STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING; _error_message = STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING;
return CHECK_STATIONS_ERR; return CHECK_STATIONS_ERR;