Apply review suggestions

This commit is contained in:
Dan Balasescu 2022-03-14 17:10:37 +09:00
parent 3fff7f4b7e
commit 028750936c
2 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,7 @@
using System;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
@ -165,7 +166,12 @@ namespace osu.Game.Rulesets.Scoring
protected override void Update()
{
base.Update();
hasCompleted.Value = JudgedHits == MaxHits && (JudgedHits == 0 || lastAppliedResult?.TimeAbsolute < Clock.CurrentTime);
hasCompleted.Value =
JudgedHits == MaxHits
&& (JudgedHits == 0
// Last applied result is guaranteed to be non-null when JudgedHits > 0.
|| lastAppliedResult.AsNonNull().TimeAbsolute < Clock.CurrentTime);
}
/// <summary>

View File

@ -76,7 +76,7 @@ namespace osu.Game.Screens.Play.HUD
performanceCalculator = gameplayState.Ruleset.CreatePerformanceCalculator();
clonedMods = gameplayState.Mods.Select(m => m.DeepClone()).ToArray();
scoreInfo = new ScoreInfo(gameplayState.Score.ScoreInfo.BeatmapInfo, gameplayState.Score.ScoreInfo.Ruleset);
scoreInfo = new ScoreInfo(gameplayState.Score.ScoreInfo.BeatmapInfo, gameplayState.Score.ScoreInfo.Ruleset) { Mods = clonedMods };
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)