summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-14 16:39:17 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit6fe445e6c0fa3163aba48b1ec6d810b6594777bd (patch)
tree320cd8d2d76b38ee06f9fde07ea349adeb3f228a /src/road_cmd.cpp
parent21675ec7e22bfe53f20300cc27b4d50c84aeb4dc (diff)
downloadopenttd-6fe445e6c0fa3163aba48b1ec6d810b6594777bd.tar.xz
Codechange: Un-bitstuff station/depot/waypoint commands.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 637b476d0..72dcb5276 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1157,21 +1157,16 @@ CommandCost CmdRemoveLongRoad(DoCommandFlag flags, TileIndex start_tile, uint32
* Build a road depot.
* @param tile tile where to build the depot
* @param flags operation to perform
- * @param p1 bit 0..1 entrance direction (DiagDirection)
- * bit 2..7 road type
- * @param p2 unused
- * @param text unused
+ * @param rt road type
+ * @param dir entrance direction
* @return the cost of this operation or an error
*
* @todo When checking for the tile slope,
* distinguish between "Flat land required" and "land sloped in wrong direction"
*/
-CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
+CommandCost CmdBuildRoadDepot(DoCommandFlag flags, TileIndex tile, RoadType rt, DiagDirection dir)
{
- DiagDirection dir = Extract<DiagDirection, 0, 2>(p1);
-
- RoadType rt = Extract<RoadType, 2, 6>(p1);
- if (!ValParamRoadType(rt)) return CMD_ERROR;
+ if (!ValParamRoadType(rt) || !IsEnumValid(dir)) return CMD_ERROR;
CommandCost cost(EXPENSES_CONSTRUCTION);