forked from mirror/OpenTTD
Codechange: Move command arguments to the back of the networked command function calls.
This commit is contained in:
@@ -141,7 +141,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh
|
||||
|
||||
if (wagon == v) return;
|
||||
|
||||
DoCommandP(v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index, CMD_MOVE_RAIL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_MOVE_VEHICLE));
|
||||
DoCommandP(CMD_MOVE_RAIL_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_MOVE_VEHICLE), v->tile, v->index | (_ctrl_pressed ? 1 : 0) << 20, wagon == nullptr ? INVALID_VEHICLE : wagon->index);
|
||||
}
|
||||
|
||||
static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view.
|
||||
@@ -802,7 +802,7 @@ struct DepotWindow : Window {
|
||||
case WID_D_STOP_ALL:
|
||||
case WID_D_START_ALL: {
|
||||
VehicleListIdentifier vli(VL_DEPOT_LIST, this->type, this->owner);
|
||||
DoCommandP(this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack(), CMD_MASS_START_STOP);
|
||||
DoCommandP(CMD_MASS_START_STOP, this->window_number, (widget == WID_D_START_ALL ? (1 << 0) : 0), vli.Pack());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -825,7 +825,7 @@ struct DepotWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_D_AUTOREPLACE:
|
||||
DoCommandP(this->window_number, this->type, 0, CMD_DEPOT_MASS_AUTOREPLACE);
|
||||
DoCommandP(CMD_DEPOT_MASS_AUTOREPLACE, this->window_number, this->type, 0);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -836,7 +836,7 @@ struct DepotWindow : Window {
|
||||
if (str == nullptr) return;
|
||||
|
||||
/* Do depot renaming */
|
||||
DoCommandP(0, this->GetDepotIndex(), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), nullptr, str);
|
||||
DoCommandP(CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), 0, this->GetDepotIndex(), 0, str);
|
||||
}
|
||||
|
||||
bool OnRightClick(Point pt, int widget) override
|
||||
@@ -904,10 +904,10 @@ struct DepotWindow : Window {
|
||||
{
|
||||
if (_ctrl_pressed) {
|
||||
/* Share-clone, do not open new viewport, and keep tool active */
|
||||
DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), nullptr);
|
||||
DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), this->window_number, v->index, 1);
|
||||
} else {
|
||||
/* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */
|
||||
if (DoCommandP(this->window_number, v->index, 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) {
|
||||
if (DoCommandP(CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle, this->window_number, v->index, 0)) {
|
||||
ResetObjectToPlace();
|
||||
}
|
||||
}
|
||||
@@ -1001,8 +1001,8 @@ struct DepotWindow : Window {
|
||||
|
||||
if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) {
|
||||
if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) {
|
||||
DoCommandP(Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true,
|
||||
CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE));
|
||||
DoCommandP(CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE),
|
||||
Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true);
|
||||
} else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) {
|
||||
this->vehicle_over = INVALID_VEHICLE;
|
||||
TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head);
|
||||
@@ -1027,7 +1027,7 @@ struct DepotWindow : Window {
|
||||
this->SetDirty();
|
||||
|
||||
int sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0;
|
||||
DoCommandP(v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0, GetCmdSellVeh(v->type));
|
||||
DoCommandP(GetCmdSellVeh(v->type), v->tile, v->index | sell_cmd << 20 | MAKE_ORDER_BACKUP_FLAG, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1091,7 +1091,7 @@ static void DepotSellAllConfirmationCallback(Window *win, bool confirmed)
|
||||
DepotWindow *w = (DepotWindow*)win;
|
||||
TileIndex tile = w->window_number;
|
||||
byte vehtype = w->type;
|
||||
DoCommandP(tile, vehtype, 0, CMD_DEPOT_SELL_ALL_VEHICLES);
|
||||
DoCommandP(CMD_DEPOT_SELL_ALL_VEHICLES, tile, vehtype, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user