Change early return to also find the earliest nested object

This commit is contained in:
Dean Herbert 2023-02-17 18:59:31 +09:00
parent 2fdf1fd876
commit 19d5293ad1

View File

@ -89,9 +89,9 @@ namespace osu.Game.Rulesets.UI
.Where(e => e.Result?.HasResult != true).MinBy(e => e.HitObject.StartTime); .Where(e => e.Result?.HasResult != true).MinBy(e => e.HitObject.StartTime);
if (fallbackObject != null) if (fallbackObject != null)
return fallbackObject.HitObject; return getEarliestNestedObject(fallbackObject.HitObject);
// In the case there are no unjudged objects, the last hit object should be used instead. // In the case there are no non-judged objects, the last hit object should be used instead.
fallbackObject ??= hitObjectContainer.Entries.LastOrDefault(); fallbackObject ??= hitObjectContainer.Entries.LastOrDefault();
} }