Make added effect points inherit previous effect point settings

This commit is contained in:
sw1tchbl4d3 2022-10-27 23:41:17 +02:00
parent d5c88cca8c
commit 446a9c1b05
1 changed files with 8 additions and 9 deletions

View File

@ -65,17 +65,16 @@ protected override Beatmap<TaikoHitObject> ConvertBeatmap(IBeatmap original, Can
foreach (HitObject hitObject in original.HitObjects)
{
double nextScrollSpeed = hitObject.DifficultyControlPoint.SliderVelocity;
EffectControlPoint currentEffectPoint = converted.ControlPointInfo.EffectPointAt(hitObject.StartTime);
if (!Precision.AlmostEquals(lastScrollSpeed, nextScrollSpeed))
if (!Precision.AlmostEquals(lastScrollSpeed, nextScrollSpeed, acceptableDifference: currentEffectPoint.ScrollSpeedBindable.Precision))
{
EffectControlPoint currentControlPoint = converted.ControlPointInfo.EffectPointAt(hitObject.StartTime);
if (Precision.AlmostEquals(currentControlPoint.Time, hitObject.StartTime))
currentControlPoint.ScrollSpeed = nextScrollSpeed;
else
converted.ControlPointInfo.Add(hitObject.StartTime, new EffectControlPoint { ScrollSpeed = nextScrollSpeed });
lastScrollSpeed = nextScrollSpeed;
converted.ControlPointInfo.Add(hitObject.StartTime, new EffectControlPoint
{
KiaiMode = currentEffectPoint.KiaiMode,
OmitFirstBarLine = currentEffectPoint.OmitFirstBarLine,
ScrollSpeed = lastScrollSpeed = nextScrollSpeed,
});
}
}
}