mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 09:42:54 +08:00
Fix potentially invalid push in player while already exiting
This commit is contained in:
parent
3861a92422
commit
17c3455b36
@ -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;
|
||||
}
|
||||
|
||||
@ -623,7 +627,12 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
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));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user