Merge branch 'resynch-fix' into 'master'

Fix clients being resynched at the wrong gametic

See merge request STJr/SRB2Internal!391
This commit is contained in:
LJ Sonic 2019-10-16 19:42:20 -04:00
commit bb9a0de4f5
1 changed files with 9 additions and 4 deletions

View File

@ -3841,7 +3841,7 @@ static void HandlePacketFromPlayer(SINT8 node)
break;
// Ignore tics from those not synched
if (resynch_inprogress[node])
if (resynch_inprogress[node] && nettics[node] == gametic)
break;
// To save bytes, only the low byte of tic numbers are sent
@ -4699,7 +4699,7 @@ void TryRunTics(tic_t realtics)
if (player_joining)
return;
if (neededtic > gametic)
if (neededtic > gametic && !resynch_local_inprogress)
{
if (advancedemo)
D_StartTitle();
@ -4853,8 +4853,13 @@ void NetUpdate(void)
for (i = 0; i < MAXNETNODES; ++i)
if (resynch_inprogress[i])
{
SV_SendResynch(i);
counts = -666;
if (!nodeingame[i] || nettics[i] == gametic)
{
SV_SendResynch(i);
counts = -666;
}
else
counts = 0; // Let the client catch up with the server
}
// Do not make tics while resynching