mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix potentially invalid push in player while already exiting
This commit is contained in:
@ -387,6 +387,10 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void onCompletion()
|
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
|
// Only show the completion screen if the player hasn't failed
|
||||||
if (HealthProcessor.HasFailed || completionProgressDelegate != null)
|
if (HealthProcessor.HasFailed || completionProgressDelegate != null)
|
||||||
return;
|
return;
|
||||||
@ -581,7 +585,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (completionProgressDelegate != null && !completionProgressDelegate.Cancelled && !completionProgressDelegate.Completed)
|
if (completionProgressDelegate != null && !completionProgressDelegate.Cancelled && !completionProgressDelegate.Completed)
|
||||||
{
|
{
|
||||||
// proceed to result screen if beatmap already finished playing
|
// proceed to result screen if beatmap already finished playing
|
||||||
scheduleGotoRanking();
|
completionProgressDelegate.RunTask();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,7 +627,12 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
var score = CreateScore();
|
var score = CreateScore();
|
||||||
if (DrawableRuleset.ReplayScore == null)
|
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
|
else
|
||||||
this.Push(CreateResults(score));
|
this.Push(CreateResults(score));
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user