summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-11-11 12:34:44 +0000
committertruelight <truelight@openttd.org>2007-11-11 12:34:44 +0000
commit8b3e27889784eaae5989ad0271c80b05b94edf46 (patch)
tree51f2c720480f1f4ac394177cbcecc18027d93e51 /src/road_cmd.cpp
parentfe24593692bc6560dffca1d33db98f1a3bec805a (diff)
downloadopenttd-8b3e27889784eaae5989ad0271c80b05b94edf46.tar.xz
(svn r11407) -Fix: do not allow building of tram-tracks when they are not available (SmatZ)
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 68ec7d957..0ae4da4af 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -405,7 +405,7 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
RoadBits pieces = Extract<RoadBits, 0>(p1);
RoadType rt = (RoadType)GB(p1, 4, 2);
- if (!IsValidRoadType(rt)) return CMD_ERROR;
+ if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR;
DisallowedRoadDirections toggle_drd = (DisallowedRoadDirections)GB(p1, 6, 2);
@@ -636,7 +636,7 @@ CommandCost CmdBuildLongRoad(TileIndex end_tile, uint32 flags, uint32 p1, uint32
start_tile = p1;
RoadType rt = (RoadType)GB(p2, 3, 2);
- if (!IsValidRoadType(rt)) return CMD_ERROR;
+ if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR;
/* Only drag in X or Y direction dictated by the direction variable */
if (!HASBIT(p2, 2) && TileY(start_tile) != TileY(end_tile)) return CMD_ERROR; // x-axis
@@ -786,7 +786,7 @@ CommandCost CmdBuildRoadDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
DiagDirection dir = Extract<DiagDirection, 0>(p1);
RoadType rt = (RoadType)GB(p1, 2, 2);
- if (!IsValidRoadType(rt)) return CMD_ERROR;
+ if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR;
tileh = GetTileSlope(tile, NULL);
if (tileh != SLOPE_FLAT && (