@@ -45,7 +45,7 @@ OrderBackup::~OrderBackup()
|
||||
* @param v The vehicle to make a backup of.
|
||||
* @param user The user that is requesting the backup.
|
||||
*/
|
||||
OrderBackup::OrderBackup(const Vehicle *v, uint32 user)
|
||||
OrderBackup::OrderBackup(const Vehicle *v, uint32_t user)
|
||||
{
|
||||
this->user = user;
|
||||
this->tile = v->tile;
|
||||
@@ -115,7 +115,7 @@ void OrderBackup::DoRestore(Vehicle *v)
|
||||
* @param user The user that is requesting the backup.
|
||||
* @note Will automatically remove any previous backups of this user.
|
||||
*/
|
||||
/* static */ void OrderBackup::Backup(const Vehicle *v, uint32 user)
|
||||
/* static */ void OrderBackup::Backup(const Vehicle *v, uint32_t user)
|
||||
{
|
||||
/* Don't use reset as that broadcasts over the network to reset the variable,
|
||||
* which is what we are doing at the moment. */
|
||||
@@ -133,7 +133,7 @@ void OrderBackup::DoRestore(Vehicle *v)
|
||||
* @param user The user that built the vehicle, thus wants to restore.
|
||||
* @note After restoration the backup will automatically be removed.
|
||||
*/
|
||||
/* static */ void OrderBackup::Restore(Vehicle *v, uint32 user)
|
||||
/* static */ void OrderBackup::Restore(Vehicle *v, uint32_t user)
|
||||
{
|
||||
for (OrderBackup *ob : OrderBackup::Iterate()) {
|
||||
if (v->tile != ob->tile || ob->user != user) continue;
|
||||
@@ -149,7 +149,7 @@ void OrderBackup::DoRestore(Vehicle *v)
|
||||
* @param user The user associated with the OrderBackup.
|
||||
* @note Must not be used from the GUI!
|
||||
*/
|
||||
/* static */ void OrderBackup::ResetOfUser(TileIndex tile, uint32 user)
|
||||
/* static */ void OrderBackup::ResetOfUser(TileIndex tile, uint32_t user)
|
||||
{
|
||||
for (OrderBackup *ob : OrderBackup::Iterate()) {
|
||||
if (ob->user == user && (ob->tile == tile || tile == INVALID_TILE)) delete ob;
|
||||
@@ -165,7 +165,7 @@ void OrderBackup::DoRestore(Vehicle *v)
|
||||
* @param text Unused.
|
||||
* @return The cost of this operation or an error.
|
||||
*/
|
||||
CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
/* 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);
|
||||
@@ -179,7 +179,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
* @pre _network_server.
|
||||
* @note Must not be used from a command.
|
||||
*/
|
||||
/* static */ void OrderBackup::ResetUser(uint32 user)
|
||||
/* static */ void OrderBackup::ResetUser(uint32_t user)
|
||||
{
|
||||
assert(_network_server);
|
||||
|
||||
@@ -204,7 +204,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
* but compiled it. A network client has its own variable for the unique
|
||||
* client/user identifier. Finally if networking isn't compiled in the
|
||||
* default is just plain and simple: 0. */
|
||||
uint32 user = _networking && !_network_server ? _network_own_client_id : CLIENT_ID_SERVER;
|
||||
uint32_t user = _networking && !_network_server ? _network_own_client_id : CLIENT_ID_SERVER;
|
||||
|
||||
for (OrderBackup *ob : OrderBackup::Iterate()) {
|
||||
/* If this is a GUI action, and it's not a backup of us, ignore it. */
|
||||
|
Reference in New Issue
Block a user