Skip to content

Commit

Permalink
now you don't have to be afraid of maps with buzz sliders 😊
Browse files Browse the repository at this point in the history
  • Loading branch information
hwabis committed Oct 9, 2024
1 parent a7e581d commit 70246eb
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -40,6 +41,16 @@ protected override IEnumerable<PumpTrainerHitObject> 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;
Expand Down

0 comments on commit 70246eb

Please sign in to comment.