Merge pull request #13781 from peppy/fix-multi-spec-test-failures

Fix master clock becoming incorrectly paused when all spectator players are too far ahead
This commit is contained in:
Dan Balasescu 2021-07-05 19:01:51 +09:00 committed by GitHub
commit 2398859b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -130,6 +130,9 @@ private void updatePlayerCatchup()
// This is a quiet case in which the catchup is done by the master clock, so IsCatchingUp is not set on the player clock.
if (timeDelta < -SYNC_TARGET)
{
// Importantly, set the clock to a non-catchup state. if this isn't done, updateMasterState may incorrectly pause the master clock
// when it is required to be running (ie. if all players are ahead of the master).
clock.IsCatchingUp = false;
clock.Stop();
continue;
}