1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Fix nested logic not being completely correct (favouring already-passed rather than near-future)

This commit is contained in:
Dean Herbert 2023-06-23 13:48:13 +09:00
parent 79606317ab
commit 64b726d5ec

View File

@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.UI
// Else we want the earliest valid nested.
// In cases of nested objects, they will always have earlier sample data than their parent object.
return getAllNested(mostValidObject.HitObject).OrderBy(h => h.StartTime).FirstOrDefault(h => h.StartTime > getReferenceTime()) ?? mostValidObject.HitObject;
return getAllNested(mostValidObject.HitObject).OrderBy(h => h.GetEndTime()).SkipWhile(h => h.GetEndTime() <= getReferenceTime()).FirstOrDefault() ?? mostValidObject.HitObject;
}
private bool isAlreadyHit(HitObjectLifetimeEntry h) => h.Result?.HasResult == true;