mirror of https://github.com/OpenRCT2/OpenRCT2.git
make desync detection work again
This commit is contained in:
parent
abcd0afa9a
commit
5bb3218d4c
11
src/game.c
11
src/game.c
|
@ -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)++;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue