1
0
Fork 0

Codechange: skip all commands of the past during desync replay

pull/12520/head
Patric Stout 2024-04-17 21:29:28 +02:00
parent a02da5476e
commit 0d4b901452
1 changed files with 10 additions and 0 deletions

View File

@ -1151,6 +1151,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];