summaryrefslogtreecommitdiff
path: root/src/tree_cmd.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-10-30 01:31:46 +0200
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commite740c24eb7a90bc771f5976d64d80639ee7576e5 (patch)
treeb3c8f0c87419cb11c106ba1cb58d6ae0648beef4 /src/tree_cmd.cpp
parentc88b104ec662ea80bec89f58aa7ad9d0baac7704 (diff)
downloadopenttd-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/tree_cmd.cpp')
-rw-r--r--src/tree_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index ab439cd58..79eaa0421 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -24,6 +24,7 @@
#include "newgrf_generic.h"
#include "date_func.h"
#include "tree_cmd.h"
+#include "landscape_cmd.h"
#include "table/strings.h"
#include "table/tree_land.h"
@@ -461,7 +462,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32
switch (GetRawClearGround(current_tile)) {
case CLEAR_FIELDS:
case CLEAR_ROCKS: {
- CommandCost ret = DoCommand(flags, CMD_LANDSCAPE_CLEAR, current_tile, 0, 0);
+ CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, current_tile, 0, 0, {});
if (ret.Failed()) return ret;
cost.AddCost(ret);
break;
@@ -882,7 +883,7 @@ void InitializeTrees()
static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
{
- return DoCommand(flags, CMD_LANDSCAPE_CLEAR, tile, 0, 0);
+ return Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile, 0, 0, {});
}