forked from mirror/OpenTTD
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
This commit is contained in:
@@ -214,7 +214,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p
|
||||
roadtypes = (RoadTypes)GB(p2, 8, 3);
|
||||
if (!AreValidRoadTypes(roadtypes) || !HasRoadTypesAvail(_current_player, roadtypes)) return CMD_ERROR;
|
||||
} else {
|
||||
if (!ValParamRailtype(GB(p2, 8, 8))) return CMD_ERROR;
|
||||
if (!ValParamRailtype((RailType)GB(p2, 8, 8))) return CMD_ERROR;
|
||||
railtype = (RailType)GB(p2, 8, 8);
|
||||
roadtypes = ROADTYPES_NONE;
|
||||
}
|
||||
@@ -462,7 +462,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, uint32 flags, uint32 p1, uint32
|
||||
|
||||
_build_tunnel_endtile = 0;
|
||||
if (!HasBit(p1, 9)) {
|
||||
if (!ValParamRailtype(p1)) return CMD_ERROR;
|
||||
if (!ValParamRailtype((RailType)p1)) return CMD_ERROR;
|
||||
} else {
|
||||
const RoadTypes rts = (RoadTypes)GB(p1, 0, 3);
|
||||
if (!AreValidRoadTypes(rts) || !HasRoadTypesAvail(_current_player, rts)) return CMD_ERROR;
|
||||
|
Reference in New Issue
Block a user