summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-10-31 19:39:09 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (patch)
tree161f0e6ac300e604de61b8203b5a58279637f9eb /src/industry_gui.cpp
parente740c24eb7a90bc771f5976d64d80639ee7576e5 (diff)
downloadopenttd-0f64ee5ce1548d9cda69917f27c5b1a3cb91823d.tar.xz
Codechange: Template DoCommandP 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/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 5aea6f59a..29da3c76e 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -39,6 +39,7 @@
#include "widgets/industry_widget.h"
#include "clear_map.h"
#include "zoom_func.h"
+#include "industry_cmd.h"
#include "table/strings.h"
@@ -679,7 +680,7 @@ public:
case WID_DPI_FUND_WIDGET: {
if (this->selected_type != INVALID_INDUSTRYTYPE) {
if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) {
- DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom());
+ Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom(), {});
this->HandleButtonClick(WID_DPI_FUND_WIDGET);
} else {
HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT);
@@ -716,13 +717,13 @@ public:
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
_ignore_restrictions = true;
- DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed);
+ Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed, {});
cur_company.Restore();
old_generating_world.Restore();
_ignore_restrictions = false;
} else {
- success = DoCommandP(CMD_BUILD_INDUSTRY, STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed);
+ success = Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed, {});
}
/* If an industry has been built, just reset the cursor and the system */