summaryrefslogtreecommitdiff
path: root/src/order_backup.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_backup.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_backup.cpp')
-rw-r--r--src/order_backup.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_backup.cpp b/src/order_backup.cpp
index 76c416abd..80fc9fa6d 100644
--- a/src/order_backup.cpp
+++ b/src/order_backup.cpp
@@ -17,6 +17,7 @@
#include "window_func.h"
#include "station_map.h"
#include "order_cmd.h"
+#include "group_cmd.h"
#include "safeguards.h"
@@ -74,7 +75,7 @@ void OrderBackup::DoRestore(Vehicle *v)
{
/* If we had shared orders, recover that */
if (this->clone != nullptr) {
- DoCommand(DC_EXEC, CMD_CLONE_ORDER, 0, v->index | CO_SHARE << 30, this->clone->index);
+ Command<CMD_CLONE_ORDER>::Do(DC_EXEC, 0, v->index | CO_SHARE << 30, this->clone->index, {});
} else if (this->orders != nullptr && OrderList::CanAllocateItem()) {
v->orders.list = new OrderList(this->orders, v);
this->orders = nullptr;
@@ -89,7 +90,7 @@ void OrderBackup::DoRestore(Vehicle *v)
if (v->cur_implicit_order_index >= v->GetNumOrders()) v->cur_implicit_order_index = v->cur_real_order_index;
/* Restore vehicle group */
- DoCommand(DC_EXEC, CMD_ADD_VEHICLE_GROUP, 0, this->group, v->index);
+ Command<CMD_ADD_VEHICLE_GROUP>::Do(DC_EXEC, 0, this->group, v->index, {});
}
/**