Codechange: Move command arguments to the back of the DoCommand function call.

This commit is contained in:
Michael Lutz
2021-10-03 15:39:49 +02:00
parent 39e8783f4b
commit b6933a2ebd
35 changed files with 167 additions and 167 deletions

View File

@@ -307,7 +307,7 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF
SetDParamStr(0, grfconfig->GetName());
SetDParam(1, engine);
ShowErrorMessage(part1, part2, WL_CRITICAL);
if (!_networking) DoCommand(0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1, DC_EXEC, CMD_PAUSE);
if (!_networking) DoCommand(DC_EXEC, CMD_PAUSE, 0, critical ? PM_PAUSED_ERROR : PM_PAUSED_NORMAL, 1);
}
/* debug output */
@@ -1055,7 +1055,7 @@ void CallVehicleTicks()
const Company *c = Company::Get(_current_company);
SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, (Money)c->settings.engine_renew_money));
CommandCost res = DoCommand(0, v->index, 0, DC_EXEC, CMD_AUTOREPLACE_VEHICLE);
CommandCost res = DoCommand(DC_EXEC, CMD_AUTOREPLACE_VEHICLE, 0, v->index, 0);
SubtractMoneyFromCompany(CommandCost(EXPENSES_NEW_VEHICLES, -(Money)c->settings.engine_renew_money));
if (!IsLocalCompany()) continue;
@@ -1561,7 +1561,7 @@ void VehicleEnterDepot(Vehicle *v)
if (v->current_order.IsRefit()) {
Backup<CompanyID> cur_company(_current_company, v->owner, FILE_LINE);
CommandCost cost = DoCommand(v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8, DC_EXEC, GetCmdRefitVeh(v));
CommandCost cost = DoCommand(DC_EXEC, GetCmdRefitVeh(v), v->tile, v->index, v->current_order.GetRefitCargo() | 0xFF << 8);
cur_company.Restore();
if (cost.Failed()) {
@@ -2443,7 +2443,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command)
/* If there is no depot in front and the train is not already reversing, reverse automatically (trains only) */
if (this->type == VEH_TRAIN && (reverse ^ HasBit(Train::From(this)->flags, VRF_REVERSING))) {
DoCommand(this->tile, this->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, this->tile, this->index, 0);
}
if (this->type == VEH_AIRCRAFT) {