Mercurial > hg > openttd
changeset 4140:55e2a0fb6563 draft
(svn r5500) Undo r4597, because it breaks the intended change of r5315 to prohibit building rails on a road tile while road works are in progress
author | tron <tron@openttd.org> |
---|---|
date | Sat, 15 Jul 2006 09:29:39 +0000 |
parents | c9a5034f6ad5 |
children | 3f08c0dcbf9e |
files | rail_cmd.c |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/rail_cmd.c +++ b/rail_cmd.c @@ -286,14 +286,16 @@ if (!EnsureNoVehicle(tile)) return CMD_ERROR; - if (GetRoadTileType(tile) == ROAD_TILE_NORMAL && - ((track == TRACK_X && GetRoadBits(tile) == ROAD_Y) || - (track == TRACK_Y && GetRoadBits(tile) == ROAD_X))) { - if (flags & DC_EXEC) { - MakeRoadCrossing(tile, GetTileOwner(tile), _current_player, (track == TRACK_X ? AXIS_Y : AXIS_X), p1, GetTownIndex(tile)); + if (GetRoadTileType(tile) == ROAD_TILE_NORMAL) { + if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS); + + if ((track == TRACK_X && GetRoadBits(tile) == ROAD_Y) || + (track == TRACK_Y && GetRoadBits(tile) == ROAD_X)) { + if (flags & DC_EXEC) { + MakeRoadCrossing(tile, GetTileOwner(tile), _current_player, (track == TRACK_X ? AXIS_Y : AXIS_X), p1, GetTownIndex(tile)); + } + break; } - - break; } if (IsLevelCrossing(tile) && GetCrossingRailBits(tile) == trackbit) {