summaryrefslogtreecommitdiff
path: root/src/rail_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/rail_cmd.cpp
parent21675ec7e22bfe53f20300cc27b4d50c84aeb4dc (diff)
downloadopenttd-6fe445e6c0fa3163aba48b1ec6d810b6594777bd.tar.xz
Codechange: Un-bitstuff station/depot/waypoint commands.
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 066fb7820..389c44dd9 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -976,24 +976,21 @@ CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex tile, uint32 p
* Build a train depot
* @param flags operation to perform
* @param tile position of the train depot
- * @param p1 rail type
- * @param p2 bit 0..1 entrance direction (DiagDirection)
+ * @param railtype rail type
+ * @param dir entrance direction
* @param text unused
* @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 CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
+CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir)
{
/* check railtype and valid direction for depot (0 through 3), 4 in total */
- RailType railtype = Extract<RailType, 0, 6>(p1);
- if (!ValParamRailtype(railtype)) return CMD_ERROR;
+ if (!ValParamRailtype(railtype) || !IsEnumValid(dir)) return CMD_ERROR;
Slope tileh = GetTileSlope(tile);
- DiagDirection dir = Extract<DiagDirection, 0, 2>(p2);
-
CommandCost cost(EXPENSES_CONSTRUCTION);
/* Prohibit construction if