|
@@ -718,25 +718,25 @@ CommandCost CheckFlatLandBelow(TileIndex
|
|
|
StationID st = GetStationIndex(tile_cur);
|
|
|
if (*station == INVALID_STATION) {
|
|
|
*station = st;
|
|
|
} else if (*station != st) {
|
|
|
return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
|
|
|
}
|
|
|
}
|
|
|
} else if (check_clear) {
|
|
|
/* Rail type is only valid when building a railway station; in station to
|
|
|
* build isn't a rail station it's INVALID_RAILTYPE. */
|
|
|
if (rt != INVALID_RAILTYPE &&
|
|
|
IsPlainRailTile(tile_cur) && !HasSignals(tile_cur) &&
|
|
|
HasPowerOnRail(GetRailType(tile), rt)) {
|
|
|
HasPowerOnRail(GetRailType(tile_cur), rt)) {
|
|
|
/* Allow overbuilding if the tile:
|
|
|
* - has rail, but no signals
|
|
|
* - it has exactly one track
|
|
|
* - the track is in line with the station
|
|
|
* - the current rail type has power on the to-be-built type (e.g. convert normal rail to el rail)
|
|
|
*/
|
|
|
TrackBits tracks = GetTrackBits(tile_cur);
|
|
|
Track track = RemoveFirstTrack(&tracks);
|
|
|
Track expected_track = HasBit(invalid_dirs, DIAGDIR_NE) ? TRACK_X : TRACK_Y;
|
|
|
|
|
|
if (tracks == TRACK_BIT_NONE && track == expected_track) {
|
|
|
CommandCost ret = DoCommand(tile_cur, 0, track, flags, CMD_REMOVE_SINGLE_RAIL);
|