make desync detection work again

This commit is contained in:
zsilencer 2015-08-19 19:07:11 -06:00
parent abcd0afa9a
commit 5bb3218d4c
2 changed files with 7 additions and 6 deletions

View File

@ -262,11 +262,6 @@ void game_update()
// make sure client doesn't fall behind the server too much
numUpdates += 10;
}
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) >= network_get_server_tick()) {
// dont run past the server
numUpdates = 0;
}
} else {
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) {
numUpdates = 0;
@ -333,6 +328,12 @@ void game_update()
void game_logic_update()
{
if (network_get_mode() == NETWORK_MODE_CLIENT) {
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) >= network_get_server_tick()) {
// dont run past the server
return;
}
}
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32)++;
RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, uint32)++;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16)++;

View File

@ -536,7 +536,7 @@ bool Network::CheckSRAND(uint32 tick, uint32 srand0)
if (server_srand0_tick == 0)
return true;
if (tick >= server_srand0_tick) {
if (tick > server_srand0_tick) { // this should not happen
server_srand0_tick = 0;
return true;
}