From 8a15d4e67703a488245ebbb6a4b183d2e6203711 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Mar 2018 16:25:08 +0900 Subject: [PATCH] Fix linear perfect-curves not being cased to CurveType.Linear Fixes #2151. --- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 2fcf3205c1..ce292ef223 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -9,6 +9,7 @@ using System.Globalization; using osu.Game.Beatmaps.Formats; using osu.Game.Audio; using System.Linq; +using osu.Framework.MathUtils; namespace osu.Game.Rulesets.Objects.Legacy { @@ -74,6 +75,11 @@ namespace osu.Game.Rulesets.Objects.Legacy points.Add(new Vector2((int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture), (int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture)) - pos); } + // osu-stable special-cased colinear perfect curves to a CurveType.Linear + bool isLinear(List p) => Precision.AlmostEquals(0, (p[1].Y - p[0].Y) * (p[2].X - p[0].X) - (p[1].X - p[0].X) * (p[2].Y - p[0].Y)); + if (points.Count == 3 && curveType == CurveType.PerfectCurve && isLinear(points)) + curveType = CurveType.Linear; + int repeatCount = Convert.ToInt32(split[6], CultureInfo.InvariantCulture); if (repeatCount > 9000)