1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

Codechange: skip all commands of the past during desync replay (#12520)

This commit is contained in:
Patric Stout
2024-04-17 22:05:45 +02:00
committed by Loïc Guilloux
parent cd6946c5a8
commit 257704ae9a

View File

@@ -1105,6 +1105,16 @@ void NetworkGameLoop()
}
}
/* Skip all entries in the command-log till we caught up with the current game again. */
if (TimerGameEconomy::date > next_date || (TimerGameEconomy::date == next_date && TimerGameEconomy::date_fract > next_date_fract)) {
Debug(desync, 0, "Skipping to next command at {:08x}:{:02x}", next_date, next_date_fract);
if (cp != nullptr) {
delete cp;
cp = nullptr;
}
check_sync_state = false;
}
if (cp != nullptr || check_sync_state) break;
char buff[4096];