summaryrefslogtreecommitdiff
path: root/src/order_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/order_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/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index e48cc95c1..45a0db99f 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -27,6 +27,7 @@
#include "order_backup.h"
#include "cheat_type.h"
#include "order_cmd.h"
+#include "train_cmd.h"
#include "table/strings.h"
@@ -2037,7 +2038,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool
v->current_order.MakeGoToDepot(destination, v->current_order.GetDepotOrderType(), v->current_order.GetNonStopType(), (OrderDepotActionFlags)(v->current_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT), v->current_order.GetRefitCargo());
/* If there is no depot in front, reverse automatically (trains only) */
- if (v->type == VEH_TRAIN && reverse) DoCommand(DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION, v->tile, v->index, 0);
+ if (v->type == VEH_TRAIN && reverse) Command<CMD_REVERSE_TRAIN_DIRECTION>::Do(DC_EXEC, v->tile, v->index, 0, {});
if (v->type == VEH_AIRCRAFT) {
Aircraft *a = Aircraft::From(v);