1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-22 14:09:10 +00:00

(svn r19654) -Codechange: Use Extract<> in more places.

This commit is contained in:
frosch
2010-04-17 13:31:41 +00:00
parent 184fa43df2
commit 75d4bc947d
24 changed files with 87 additions and 63 deletions

View File

@@ -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;