Codechange: Un-bitstuff station/depot/waypoint commands.

This commit is contained in:
Michael Lutz
2021-11-14 16:39:17 +01:00
parent 21675ec7e2
commit 6fe445e6c0
28 changed files with 218 additions and 333 deletions

View File

@@ -95,15 +95,12 @@ static void MarkCanalsAndRiversAroundDirty(TileIndex tile)
* Build a ship depot.
* @param flags type of operation
* @param tile tile where ship depot is built
* @param p1 bit 0 depot orientation (Axis)
* @param p2 unused
* @param text unused
* @param axis depot orientation (Axis)
* @return the cost of this operation or an error
*/
CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
CommandCost CmdBuildShipDepot(DoCommandFlag flags, TileIndex tile, Axis axis)
{
Axis axis = Extract<Axis, 0, 1>(p1);
if (!IsEnumValid(axis)) return CMD_ERROR;
TileIndex tile2 = tile + (axis == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
if (!HasTileWaterGround(tile) || !HasTileWaterGround(tile2)) {