diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-10-30 01:31:46 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | e740c24eb7a90bc771f5976d64d80639ee7576e5 (patch) | |
tree | b3c8f0c87419cb11c106ba1cb58d6ae0648beef4 /src/vehicle_gui.cpp | |
parent | c88b104ec662ea80bec89f58aa7ad9d0baac7704 (diff) | |
download | openttd-e740c24eb7a90bc771f5976d64d80639ee7576e5.tar.xz |
Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index cac1985b9..d5d6978cc 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -37,6 +37,7 @@ #include "tilehighlight_func.h" #include "zoom_func.h" #include "depot_cmd.h" +#include "vehicle_cmd.h" #include "safeguards.h" @@ -773,8 +774,8 @@ struct RefitWindow : public Window { { assert(_current_company == _local_company); Vehicle *v = Vehicle::Get(this->window_number); - CommandCost cost = DoCommand(DC_QUERY_COST, CMD_REFIT_VEHICLE, v->tile, this->selected_vehicle, option->cargo | - option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24); + CommandCost cost = Command<CMD_REFIT_VEHICLE>::Do(DC_QUERY_COST, v->tile, this->selected_vehicle, option->cargo | + option->subtype << 8 | this->num_vehicles << 16 | (int)this->auto_refit << 24, {}); if (cost.Failed()) return INVALID_STRING_ID; |