1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 16:20:30 +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
Unverified
parent 156a518068
commit a9e4a0ed50
@@ -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);