summaryrefslogtreecommitdiff
path: root/road_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 /road_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 'road_cmd.c')
-rw-r--r--road_cmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/road_cmd.c b/road_cmd.c
index cd8263c31..7f99d6d0a 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -155,6 +155,8 @@ int32 CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
RoadBits present = GetRoadBits(tile);
RoadBits c = pieces;
+ if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
+
if (GetTileSlope(tile, NULL) != SLOPE_FLAT &&
(present == ROAD_Y || present == ROAD_X)) {
c |= (c & 0xC) >> 2;
@@ -291,6 +293,8 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
case MP_STREET:
switch (GetRoadTileType(tile)) {
case ROAD_TILE_NORMAL:
+ if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
+
existing = GetRoadBits(tile);
if ((existing & pieces) == pieces) {
return_cmd_error(STR_1007_ALREADY_BUILT);