mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
Codechange: enum-class-ify Commands
This commit is contained in:
@@ -66,7 +66,7 @@ void OrderBackup::DoRestore(Vehicle *v)
|
||||
{
|
||||
/* If we had shared orders, recover that */
|
||||
if (this->clone != nullptr) {
|
||||
Command<CMD_CLONE_ORDER>::Do(DoCommandFlag::Execute, CO_SHARE, v->index, this->clone->index);
|
||||
Command<Commands::CloneOrder>::Do(DoCommandFlag::Execute, CO_SHARE, v->index, this->clone->index);
|
||||
} else if (!this->orders.empty() && OrderList::CanAllocateItem()) {
|
||||
v->orders = OrderList::Create(std::move(this->orders), v);
|
||||
/* Make sure buoys/oil rigs are updated in the station list. */
|
||||
@@ -83,7 +83,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 */
|
||||
Command<CMD_ADD_VEHICLE_GROUP>::Do(DoCommandFlag::Execute, this->group, v->index, false, VehicleListIdentifier{});
|
||||
Command<Commands::AddVehicleToGroup>::Do(DoCommandFlag::Execute, this->group, v->index, false, VehicleListIdentifier{});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlags flags, TileIndex tile, ClientID u
|
||||
/* If it's not a backup of us, ignore it. */
|
||||
if (ob->user != user) continue;
|
||||
|
||||
Command<CMD_CLEAR_ORDER_BACKUP>::Post(TileIndex{}, static_cast<ClientID>(user));
|
||||
Command<Commands::ClearOrderBackup>::Post(TileIndex{}, static_cast<ClientID>(user));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlags flags, TileIndex tile, ClientID u
|
||||
/* We need to circumvent the "prevention" from this command being executed
|
||||
* while the game is paused, so use the internal method. Nor do we want
|
||||
* this command to get its cost estimated when shift is pressed. */
|
||||
Command<CMD_CLEAR_ORDER_BACKUP>::Unsafe<CommandCallback>(STR_NULL, nullptr, true, false, ob->tile, CommandTraits<CMD_CLEAR_ORDER_BACKUP>::Args{ ob->tile, static_cast<ClientID>(user) });
|
||||
Command<Commands::ClearOrderBackup>::Unsafe<CommandCallback>(STR_NULL, nullptr, true, false, ob->tile, CommandTraits<Commands::ClearOrderBackup>::Args{ ob->tile, static_cast<ClientID>(user) });
|
||||
} else {
|
||||
/* The command came from the game logic, i.e. the clearing of a tile.
|
||||
* In that case we have no need to actually sync this, just do it. */
|
||||
|
||||
Reference in New Issue
Block a user