1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 09:42:54 +08:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Dan Balasescu
aa49965cc2
Merge pull request #8355 from peppy/fix-invalid-push-from-player
Fix potentially invalid push in player while already exiting
2020-03-19 22:55:54 +09:00
Dan Balasescu
2b5d4a7cb7
Merge branch 'master' into fix-invalid-push-from-player 2020-03-19 22:31:41 +09:00
Dean Herbert
855f0a4253 Fix bracket style 2020-03-19 14:38:49 +09:00
Dean Herbert
17c3455b36 Fix potentially invalid push in player while already exiting 2020-03-19 14:10:59 +09:00

View File

@ -387,6 +387,10 @@ namespace osu.Game.Screens.Play
private void onCompletion()
{
// screen may be in the exiting transition phase.
if (!this.IsCurrentScreen())
return;
// Only show the completion screen if the player hasn't failed
if (HealthProcessor.HasFailed || completionProgressDelegate != null)
return;
@ -581,7 +585,7 @@ namespace osu.Game.Screens.Play
if (completionProgressDelegate != null && !completionProgressDelegate.Cancelled && !completionProgressDelegate.Completed)
{
// proceed to result screen if beatmap already finished playing
scheduleGotoRanking();
completionProgressDelegate.RunTask();
return true;
}
@ -622,8 +626,16 @@ namespace osu.Game.Screens.Play
completionProgressDelegate = Schedule(delegate
{
var score = CreateScore();
if (DrawableRuleset.ReplayScore == null)
scoreManager.Import(score).ContinueWith(_ => Schedule(() => this.Push(CreateResults(score))));
{
scoreManager.Import(score).ContinueWith(_ => Schedule(() =>
{
// screen may be in the exiting transition phase.
if (this.IsCurrentScreen())
this.Push(CreateResults(score));
}));
}
else
this.Push(CreateResults(score));
});