From 4c744ccb698e9f41cc350fcde45159a30ec52944 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 26 Feb 2024 14:11:54 +0800 Subject: [PATCH] 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. --- osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs b/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs index b2f38662cc..8bff5fe6ac 100644 --- a/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs +++ b/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs @@ -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; }