1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 04:52:55 +08:00

Remove unnecessary (and no longer correct) exception

This commit is contained in:
Dean Herbert 2021-06-18 15:56:58 +09:00
parent 2bf855fcca
commit 7ef8eac773

View File

@ -665,9 +665,6 @@ namespace osu.Game.Screens.Play
return; return;
} }
if (resultsDisplayDelegate != null)
throw new InvalidOperationException(@$"{nameof(scoreCompletionChanged)} should never be fired more than once.");
// 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) if (HealthProcessor.HasFailed)
return; return;
@ -703,6 +700,7 @@ namespace osu.Game.Screens.Play
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// A final display will only occur once all work is completed in <see cref="PrepareScoreForResultsAsync"/>. /// A final display will only occur once all work is completed in <see cref="PrepareScoreForResultsAsync"/>.
/// This means that even after calling this method, the results screen will never be shown until <see cref="JudgementProcessor.HasCompleted">ScoreProcessor.HasCompleted</see> becomes <see langword="true"/>.
/// </remarks> /// </remarks>
/// <param name="withDelay">Whether a minimum delay (<see cref="RESULTS_DISPLAY_DELAY"/>) should be added before the screen is displayed.</param> /// <param name="withDelay">Whether a minimum delay (<see cref="RESULTS_DISPLAY_DELAY"/>) should be added before the screen is displayed.</param>
private void progressToResults(bool withDelay) private void progressToResults(bool withDelay)
@ -756,30 +754,6 @@ namespace osu.Game.Screens.Play
return Score.ScoreInfo; return Score.ScoreInfo;
} }
private void scheduleCompletion() => resultsDisplayDelegate = Schedule(() =>
{
if (!prepareScoreForDisplayTask.IsCompleted)
{
resultsDisplayDelegate = Schedule(() =>
{
if (!prepareScoreForDisplayTask.IsCompleted)
{
scheduleCompletion();
return;
}
// screen may be in the exiting transition phase.
if (this.IsCurrentScreen())
this.Push(CreateResults(prepareScoreForDisplayTask.Result));
});
return;
}
// screen may be in the exiting transition phase.
if (this.IsCurrentScreen())
this.Push(CreateResults(prepareScoreForDisplayTask.Result));
});
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value; protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value;
#region Fail Logic #region Fail Logic