1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Fix potentially starting play when finished

The UserFinishedPlaying event may trigger before the event is subscribed
to by SpectatorScreen. For such cases, an extra check is done to make
sure the user is _actually_ playing.
This commit is contained in:
smoogipoo 2021-04-20 21:17:24 +09:00
parent 156a518068
commit a9e4a0ed50

View File

@ -127,6 +127,10 @@ namespace osu.Game.Screens.Spectate
if (!userMap.ContainsKey(userId))
return;
// The user may have stopped playing.
if (!spectatorClient.TryGetPlayingUserState(userId, out _))
return;
Schedule(() => OnUserStateChanged(userId, state));
updateGameplayState(userId);