Fix OrderBackup::Reset in non-GUI case

See: https://github.com/OpenTTD/OpenTTD/issues/9735
This commit is contained in:
Jonathan G Rennison
2021-12-06 18:30:46 +00:00
parent b75a633dc6
commit 117eb6637d

View File

@@ -216,8 +216,8 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1,
uint32 user = _networking && !_network_server ? _network_own_client_id : CLIENT_ID_SERVER; uint32 user = _networking && !_network_server ? _network_own_client_id : CLIENT_ID_SERVER;
for (OrderBackup *ob : OrderBackup::Iterate()) { for (OrderBackup *ob : OrderBackup::Iterate()) {
/* If it's not a backup of us, ignore it. */ /* If this is a GUI action, and it's not a backup of us, ignore it. */
if (ob->user != user) continue; if (from_gui && ob->user != user) continue;
/* If it's not for our chosen tile either, ignore it. */ /* If it's not for our chosen tile either, ignore it. */
if (t != INVALID_TILE && t != ob->tile) continue; if (t != INVALID_TILE && t != ob->tile) continue;