1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Add a maximum length for slider ticks to be generated

This commit is contained in:
smoogipoo 2019-01-03 18:51:47 +09:00
parent 6156359ff1
commit 273b14b19c

View File

@ -24,6 +24,12 @@ namespace osu.Game.Rulesets.Osu.Objects
/// </summary> /// </summary>
private const float base_scoring_distance = 100; private const float base_scoring_distance = 100;
/// <summary>
/// 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.
/// </summary>
private const double max_length_for_ticks = 100000;
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity; public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
public double Duration => EndTime - StartTime; public double Duration => EndTime - StartTime;
@ -189,7 +195,7 @@ namespace osu.Game.Rulesets.Osu.Objects
private void createTicks() private void createTicks()
{ {
var length = Path.Distance; var length = Math.Min(max_length_for_ticks, Path.Distance);
var tickDistance = MathHelper.Clamp(TickDistance, 0, length); var tickDistance = MathHelper.Clamp(TickDistance, 0, length);
if (tickDistance == 0) return; if (tickDistance == 0) return;