summaryrefslogtreecommitdiff
path: root/src/order_backup.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-02 21:34:39 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit4f3ea3907e23428461c626b6c861d834b358bc9f (patch)
treef60f17d713ed155a738adb469eed7f4262ffbe3c /src/order_backup.cpp
parentccefa76a4686581b8d1a9bd13d7d754807a9f8d1 (diff)
downloadopenttd-4f3ea3907e23428461c626b6c861d834b358bc9f.tar.xz
Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID).
Diffstat (limited to 'src/order_backup.cpp')
-rw-r--r--src/order_backup.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/order_backup.cpp b/src/order_backup.cpp
index 6bececc0c..69ae6507d 100644
--- a/src/order_backup.cpp
+++ b/src/order_backup.cpp
@@ -144,15 +144,13 @@ void OrderBackup::DoRestore(Vehicle *v)
* Clear an OrderBackup
* @param flags For command.
* @param tile Tile related to the to-be-cleared OrderBackup.
- * @param p1 Unused.
- * @param p2 User that had the OrderBackup.
- * @param text Unused.
+ * @param user_id User that had the OrderBackup.
* @return The cost of this operation or an error.
*/
-CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
+CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID user_id)
{
/* No need to check anything. If the tile or user don't exist we just ignore it. */
- if (flags & DC_EXEC) OrderBackup::ResetOfUser(tile == 0 ? INVALID_TILE : tile, p2);
+ if (flags & DC_EXEC) OrderBackup::ResetOfUser(tile == 0 ? INVALID_TILE : tile, user_id);
return CommandCost();
}
@@ -171,7 +169,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1,
/* If it's not a backup of us, ignore it. */
if (ob->user != user) continue;
- Command<CMD_CLEAR_ORDER_BACKUP>::Post(0, 0, user, {});
+ Command<CMD_CLEAR_ORDER_BACKUP>::Post(0, static_cast<ClientID>(user));
return;
}
}
@@ -200,7 +198,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, uint32 p1,
/* 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(STR_NULL, nullptr, true, false, ob->tile, CommandTraits<CMD_CLEAR_ORDER_BACKUP>::Args{ ob->tile, 0, user, {} });
+ Command<CMD_CLEAR_ORDER_BACKUP>::Unsafe(STR_NULL, nullptr, true, false, ob->tile, CommandTraits<CMD_CLEAR_ORDER_BACKUP>::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. */