diff options
author | frosch <frosch@openttd.org> | 2010-04-17 13:31:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-04-17 13:31:41 +0000 |
commit | 75d4bc947ddbb92ecf660d9a9858c854d5e34a15 (patch) | |
tree | b218a672a78b894388373d2e700e6ad6ebe75b63 /src/road_cmd.cpp | |
parent | 184fa43df2e14c73162e641bc9bc83e403f069ed (diff) | |
download | openttd-75d4bc947ddbb92ecf660d9a9858c854d5e34a15.tar.xz |
(svn r19654) -Codechange: Use Extract<> in more places.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 8f3832dc6..10b902714 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -469,10 +469,10 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* do not allow building 'zero' road bits, code wouldn't handle it */ if (pieces == ROAD_NONE) return CMD_ERROR; - RoadType rt = (RoadType)GB(p1, 4, 2); + RoadType rt = Extract<RoadType, 4, 2>(p1); if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR; - DisallowedRoadDirections toggle_drd = (DisallowedRoadDirections)GB(p1, 6, 2); + DisallowedRoadDirections toggle_drd = Extract<DisallowedRoadDirections, 6, 2>(p1); Slope tileh = GetTileSlope(tile, NULL); @@ -726,7 +726,7 @@ CommandCost CmdBuildLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 p if (p1 >= MapSize()) return CMD_ERROR; TileIndex end_tile = p1; - RoadType rt = (RoadType)GB(p2, 3, 2); + RoadType rt = Extract<RoadType, 3, 2>(p2); if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR; Axis axis = Extract<Axis, 2, 1>(p2); @@ -818,7 +818,7 @@ CommandCost CmdRemoveLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 if (p1 >= MapSize()) return CMD_ERROR; TileIndex end_tile = p1; - RoadType rt = (RoadType)GB(p2, 3, 2); + RoadType rt = Extract<RoadType, 3, 2>(p2); if (!IsValidRoadType(rt)) return CMD_ERROR; Axis axis = Extract<Axis, 2, 1>(p2); @@ -887,7 +887,7 @@ CommandCost CmdRemoveLongRoad(TileIndex start_tile, DoCommandFlag flags, uint32 CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { DiagDirection dir = Extract<DiagDirection, 0, 2>(p1); - RoadType rt = (RoadType)GB(p1, 2, 2); + RoadType rt = Extract<RoadType, 2, 2>(p1); if (!IsValidRoadType(rt) || !ValParamRoadType(rt)) return CMD_ERROR; |