mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 08:33:55 +09:00
Merge pull request #12715 from Cublibre/fix-early-exit-crash
Fix InvalidOperationException when exiting a map at the end
This commit is contained in:
@ -133,6 +133,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddUntilStep("storyboard ends", () => Player.GameplayClockContainer.GameplayClock.CurrentTime >= currentStoryboardDuration);
|
AddUntilStep("storyboard ends", () => Player.GameplayClockContainer.GameplayClock.CurrentTime >= currentStoryboardDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPerformExitNoOutro()
|
||||||
|
{
|
||||||
|
CreateTest(null);
|
||||||
|
AddStep("disable storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, false));
|
||||||
|
AddUntilStep("completion set by processor", () => Player.ScoreProcessor.HasCompleted.Value);
|
||||||
|
AddStep("exit via pause", () => Player.ExitViaPause());
|
||||||
|
AddAssert("player exited", () => Stack.CurrentScreen == null);
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool AllowFail => true;
|
protected override bool AllowFail => true;
|
||||||
|
|
||||||
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
||||||
|
@ -543,9 +543,11 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the score is ready for display but results screen has not been pushed yet (e.g. storyboard is still playing beyond gameplay), then transition to results screen instead of exiting.
|
// if the score is ready for display but results screen has not been pushed yet (e.g. storyboard is still playing beyond gameplay), then transition to results screen instead of exiting.
|
||||||
if (prepareScoreForDisplayTask != null)
|
if (prepareScoreForDisplayTask != null && completionProgressDelegate == null)
|
||||||
|
{
|
||||||
updateCompletionState(true);
|
updateCompletionState(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.Exit();
|
this.Exit();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user