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/disaster_vehicle.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/disaster_vehicle.cpp')
-rw-r--r-- | src/disaster_vehicle.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index 63f4188a8..6319af0ab 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -45,6 +45,7 @@ #include "company_base.h" #include "core/random_func.hpp" #include "core/backup_type.hpp" +#include "landscape_cmd.h" #include "table/strings.h" @@ -61,7 +62,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_RAILWAY: if (Company::IsHumanID(GetTileOwner(tile)) && !IsRailDepot(tile)) { Backup<CompanyID> cur_company(_current_company, OWNER_WATER, FILE_LINE); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC, tile, 0, 0, {}); cur_company.Restore(); /* update signals in buffer */ @@ -71,7 +72,7 @@ static void DisasterClearSquare(TileIndex tile) case MP_HOUSE: { Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE); - DoCommand(DC_EXEC, CMD_LANDSCAPE_CLEAR, tile, 0, 0); + Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC, tile, 0, 0, {}); cur_company.Restore(); break; } |