From 70246eb3a1d57085edebb6856000d8ec5079cf97 Mon Sep 17 00:00:00 2001 From: hwabis Date: Tue, 8 Oct 2024 22:01:47 -0400 Subject: [PATCH] =?UTF-8?q?now=20you=20don't=20have=20to=20be=20afraid=20o?= =?UTF-8?q?f=20maps=20with=20buzz=20sliders=20=F0=9F=98=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Beatmaps/PumpTrainerBeatmapConverter.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerBeatmapConverter.cs b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerBeatmapConverter.cs index 5b741b7..1ab393d 100644 --- a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerBeatmapConverter.cs +++ b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerBeatmapConverter.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Threading; using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.PumpTrainer.Objects; @@ -40,6 +41,16 @@ protected override IEnumerable ConvertHitObject(HitObject int hitObjectsToReturnAfterFirst = hasRepeats.RepeatCount + 1; // +1 for the last hit object double durationBetweenPoints = (hasRepeats.EndTime - original.StartTime) / hitObjectsToReturnAfterFirst; + // Buzz slider protection! + // If the duration between the points is too small (e.g. the beatmap has a 1/6 or 1/8 buzz slider instead of the typical 1/4 (blue tick)), + // fill the duration with notes 1/4 apart instead of with the original rhythm. + TimingControlPoint currentTimingPoint = beatmap.ControlPointInfo.TimingPointAt(original.StartTime); + + if (durationBetweenPoints < currentTimingPoint.BeatLength / 4) + { + durationBetweenPoints = currentTimingPoint.BeatLength / 4; + } + const double rounding_error = 5; for (double newHitObjectTime = original.StartTime + durationBetweenPoints;