summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-10-03 15:39:49 +0200
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commitb6933a2ebdf66c5fb23b2226d3ce07d71426d7d2 (patch)
tree0cb31934ea674ea3b8bb23dd118db803b319fe7c /src/station_cmd.cpp
parent39e8783f4b8d24a27d28f99905acf8f54dec24fa (diff)
downloadopenttd-b6933a2ebdf66c5fb23b2226d3ce07d71426d7d2.tar.xz
Codechange: Move command arguments to the back of the DoCommand function call.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 1a188252c..713d38374 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -841,7 +841,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo
if (ret.Failed()) return ret;
cost.AddCost(ret);
- ret = DoCommand(tile_iter, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_iter, 0, 0);
if (ret.Failed()) return ret;
cost.AddCost(ret);
}
@@ -921,14 +921,14 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl
affected_vehicles.push_back(v);
}
}
- CommandCost ret = DoCommand(tile_cur, 0, track, flags, CMD_REMOVE_SINGLE_RAIL);
+ CommandCost ret = DoCommand(flags, CMD_REMOVE_SINGLE_RAIL, tile_cur, 0, track);
if (ret.Failed()) return ret;
cost.AddCost(ret);
/* With flags & ~DC_EXEC CmdLandscapeClear would fail since the rail still exists */
continue;
}
}
- ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0);
if (ret.Failed()) return ret;
cost.AddCost(ret);
}
@@ -1046,7 +1046,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
cost.AddCost(RoadBuildCost(rt) * 2);
}
} else {
- ret = DoCommand(cur_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, cur_tile, 0, 0);
if (ret.Failed()) return ret;
cost.AddCost(ret);
cost.AddCost(RoadBuildCost(rt) * 2);
@@ -1752,7 +1752,7 @@ static CommandCost RemoveRailStation(TileIndex tile, DoCommandFlag flags)
{
/* if there is flooding, remove platforms tile by tile */
if (_current_company == OWNER_WATER) {
- return DoCommand(tile, 0, 0, DC_EXEC, CMD_REMOVE_FROM_RAIL_STATION);
+ return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_STATION, tile, 0, 0);
}
Station *st = Station::GetByTile(tile);
@@ -1773,7 +1773,7 @@ static CommandCost RemoveRailWaypoint(TileIndex tile, DoCommandFlag flags)
{
/* if there is flooding, remove waypoints tile by tile */
if (_current_company == OWNER_WATER) {
- return DoCommand(tile, 0, 0, DC_EXEC, CMD_REMOVE_FROM_RAIL_WAYPOINT);
+ return DoCommand(DC_EXEC, CMD_REMOVE_FROM_RAIL_WAYPOINT, tile, 0, 0);
}
return RemoveRailStation(Waypoint::GetByTile(tile), flags, _price[PR_CLEAR_WAYPOINT_RAIL]);
@@ -2535,7 +2535,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]);
- ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0);
if (ret.Failed()) return ret;
cost.AddCost(ret);
@@ -2550,7 +2550,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Get the water class of the water tile before it is cleared.*/
WaterClass wc = GetWaterClass(tile_cur);
- ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile_cur, 0, 0);
if (ret.Failed()) return ret;
tile_cur += TileOffsByDiagDir(direction);
@@ -4240,12 +4240,12 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o
} else {
if (IsDriveThroughStopTile(tile)) {
/* Remove the drive-through road stop */
- DoCommand(tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP);
+ DoCommand(DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP, tile, 1 | 1 << 8, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS);
assert(IsTileType(tile, MP_ROAD));
/* Change owner of tile and all roadtypes */
ChangeTileOwner(tile, old_owner, new_owner);
} else {
- DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
+ DoCommand(DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR, tile, 0, 0);
/* Set tile owner of water under (now removed) buoy and dock to OWNER_NONE.
* Update owner of buoy if it was not removed (was in orders).
* Do not update when owned by OWNER_WATER (sea and rivers). */
@@ -4362,7 +4362,7 @@ static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, in
}
}
}
- return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+ return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0);
}
/**