Fix "Use current" snap not working

Regressed with https://github.com/ppy/osu/pull/27249.

I was suspicious of this specific operation at the time but didn't test properly.
This commit is contained in:
Dean Herbert 2024-02-26 14:11:54 +08:00
parent b0c45c87c6
commit 4c744ccb69
No known key found for this signature in database

View File

@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Edit
if (objTime >= editorClock.CurrentTime)
continue;
if (objTime > lastBefore?.StartTime)
if (lastBefore == null || objTime > lastBefore?.StartTime)
lastBefore = entry.Value.HitObject;
}
@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Edit
if (objTime < editorClock.CurrentTime)
continue;
if (objTime < firstAfter?.StartTime)
if (firstAfter == null || objTime < firstAfter?.StartTime)
firstAfter = entry.Value.HitObject;
}