Fix audio being paused in a spectator session when all players finish playing

This commit is contained in:
Dean Herbert 2024-04-26 15:30:26 +08:00
parent 21d6556865
commit fb2d28f7e0
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -177,7 +177,9 @@ private void updatePlayerCatchup()
/// </summary>
private void updateMasterState()
{
MasterClockState newState = playerClocks.Any(s => !s.IsCatchingUp) ? MasterClockState.Synchronised : MasterClockState.TooFarAhead;
// Clocks are removed as players complete the beatmap.
// Once there are no clocks we want to make sure the track plays out to the end.
MasterClockState newState = playerClocks.Count == 0 || playerClocks.Any(s => !s.IsCatchingUp) ? MasterClockState.Synchronised : MasterClockState.TooFarAhead;
if (masterState == newState)
return;