summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-19 17:22:57 +0000
committertron <tron@openttd.org>2006-06-19 17:22:57 +0000
commit431baba8fed63c52ba11fffc2a1242248a5830db (patch)
tree96b559696bd3fbcc26188de4966bf22e7a6d82cc /rail_cmd.c
parentc61b617a169d2e98648f11288e45bab0080d9cc5 (diff)
downloadopenttd-431baba8fed63c52ba11fffc2a1242248a5830db.tar.xz
(svn r5315) -Fix: Prohibit altering a road tile while road works are in progress
This fixes some glitches like "turning" the excavation by adding/removing road bits or removing the road piece
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index eb4c4b79a..028c8592c 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -286,12 +286,14 @@ int32 CmdBuildSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
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;
}