1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-20 07:17:31 +08:00

Fix "finished playing" events handled for potentially incorrect user

This commit is contained in:
Dean Herbert 2020-10-28 16:11:14 +09:00
parent 6eddd76bdc
commit 48b0357e7d

View File

@ -167,6 +167,16 @@ namespace osu.Game.Screens.Play
attemptStart();
}
private void userFinishedPlaying(int userId, SpectatorState state)
{
if (userId != targetUser.Id)
return;
if (replay == null) return;
replay.HasReceivedAllFrames = true;
}
private void attemptStart()
{
var resolvedRuleset = rulesets.AvailableRulesets.FirstOrDefault(r => r.ID == state.RulesetID)?.CreateInstance();
@ -216,13 +226,6 @@ namespace osu.Game.Screens.Play
api.Queue(req);
}
private void userFinishedPlaying(int userId, SpectatorState state)
{
if (replay == null) return;
replay.HasReceivedAllFrames = true;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);