diff options
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 6 |
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 && ( |