diff options
author | truelight <truelight@openttd.org> | 2007-11-11 12:34:44 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-11-11 12:34:44 +0000 |
commit | 8b3e27889784eaae5989ad0271c80b05b94edf46 (patch) | |
tree | 51f2c720480f1f4ac394177cbcecc18027d93e51 /src/tunnelbridge_cmd.cpp | |
parent | fe24593692bc6560dffca1d33db98f1a3bec805a (diff) | |
download | openttd-8b3e27889784eaae5989ad0271c80b05b94edf46.tar.xz |
(svn r11407) -Fix: do not allow building of tram-tracks when they are not available (SmatZ)
Diffstat (limited to 'src/tunnelbridge_cmd.cpp')
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index d5ff51d95..1bd4322f5 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -213,7 +213,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p if (HASBIT(p2, 15)) { railtype = INVALID_RAILTYPE; // road bridge roadtypes = (RoadTypes)GB(p2, 8, 3); - if (!AreValidRoadTypes(roadtypes)) return CMD_ERROR; + if (!AreValidRoadTypes(roadtypes) || !HasRoadTypesAvail(_current_player, roadtypes)) return CMD_ERROR; } else { if (!ValParamRailtype(GB(p2, 8, 8))) return CMD_ERROR; railtype = (RailType)GB(p2, 8, 8); @@ -464,8 +464,9 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, uint32 flags, uint32 p1, uint32 _build_tunnel_endtile = 0; if (!HASBIT(p1, 9)) { if (!ValParamRailtype(p1)) return CMD_ERROR; - } else if (!AreValidRoadTypes((RoadTypes)GB(p1, 0, 3))) { - return CMD_ERROR; + } else { + const RoadTypes rts = (RoadTypes)GB(p1, 0, 3); + if (!AreValidRoadTypes(rts) || !HasRoadTypesAvail(_current_player, rts)) return CMD_ERROR; } start_tileh = GetTileSlope(start_tile, &start_z); |