From 273b14b19cc74a2feb60e0940f60a6f206f1e3e3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 3 Jan 2019 18:51:47 +0900 Subject: [PATCH] Add a maximum length for slider ticks to be generated --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index ffb7f7be9e..2d82f7aecf 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -24,6 +24,12 @@ namespace osu.Game.Rulesets.Osu.Objects /// private const float base_scoring_distance = 100; + /// + /// A very lenient maximum length of a slider for ticks to be generated. + /// This exists for edge cases such as /b/1573664 where the beatmap has been edited by the user, and should never be reached in normal usage. + /// + private const double max_length_for_ticks = 100000; + public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity; public double Duration => EndTime - StartTime; @@ -189,7 +195,7 @@ namespace osu.Game.Rulesets.Osu.Objects private void createTicks() { - var length = Path.Distance; + var length = Math.Min(max_length_for_ticks, Path.Distance); var tickDistance = MathHelper.Clamp(TickDistance, 0, length); if (tickDistance == 0) return;