summaryrefslogtreecommitdiff
path: root/src/tree_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/tree_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/tree_gui.cpp')
-rw-r--r--src/tree_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp
index f176668b1..794135716 100644
--- a/src/tree_gui.cpp
+++ b/src/tree_gui.cpp
@@ -19,6 +19,7 @@
#include "strings_func.h"
#include "zoom_func.h"
#include "tree_map.h"
+#include "tree_cmd.h"
#include "widgets/tree_widget.h"
@@ -230,7 +231,7 @@ public:
TileIndex tile = TileVirtXY(pt.x, pt.y);
if (this->mode == PM_NORMAL) {
- DoCommandP(CMD_PLANT_TREE, tile, this->tree_to_plant, tile);
+ Command<CMD_PLANT_TREE>::Post(tile, this->tree_to_plant, tile, {});
} else {
this->DoPlantForest(tile);
}
@@ -240,7 +241,7 @@ public:
void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override
{
if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) {
- DoCommandP(CMD_PLANT_TREE, STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile);
+ Command<CMD_PLANT_TREE>::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, this->tree_to_plant, start_tile, {});
}
}