summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp10
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;