From 88d80016aa72499ec90e1d85ced314a9ad805cfe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 10:40:03 +0900 Subject: [PATCH 1/4] Fix out of bounds exception during indexing --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index f064d53358..41056a2536 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,8 +122,14 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; + if (l > 0) + { + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; + } + + // If the binary search failed, l will be unaffected + return list[l]; } } } From 117c514479bda0f92be4e430ec7a2887bb548edf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:07:25 +0900 Subject: [PATCH 2/4] Fix lazy slider calculation inaccuracy What were we doing... On /b/1221540 stable's repeat points happen 90% through the length of each span! We should use lazer's more accurate calculations. --- .../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs index d8e3b340c9..1752caf74b 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -101,8 +101,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing float approxFollowCircleRadius = (float)(slider.Radius * 3); var computeVertex = new Action(t => { - double progress = ((int)t - (int)slider.StartTime) / (float)(int)slider.SpanDuration; - if (progress % 2 > 1) + double progress = (t - slider.StartTime) / slider.SpanDuration; + if (progress % 2 >= 1) progress = 1 - progress % 1; else progress = progress % 1; From e44bc57a3da642d24f1e576953cc24b5ea234a15 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:15:52 +0900 Subject: [PATCH 3/4] Fix minDistanceFromEnd using seconds rather than milliseconds Velocity in stable is defined as distance per SECOND, while lazer defines it as distance per MILLISECOND. --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 44185fb83a..69da1bef6f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Osu.Objects if (tickDistance == 0) return; - var minDistanceFromEnd = Velocity * 0.01; + var minDistanceFromEnd = Velocity * 10; var spanCount = this.SpanCount(); From 5ecc07b729803c0c101c2a3783aa07995668837a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 20 Jan 2019 12:05:08 +0900 Subject: [PATCH 4/4] Revert "Fix out of bounds exception during indexing" This reverts commit 88d80016aa72499ec90e1d85ced314a9ad805cfe. --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index 41056a2536..f064d53358 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,14 +122,8 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - if (l > 0) - { - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; - } - - // If the binary search failed, l will be unaffected - return list[l]; + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; } } }