mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 13:33:20 +08:00
add back protection against perfect curve segments with > 3 points
This commit is contained in:
parent
db568bfb79
commit
eefd7cf083
@ -347,17 +347,23 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
vertices[i] = new PathControlPoint { Position = points[i] };
|
vertices[i] = new PathControlPoint { Position = points[i] };
|
||||||
|
|
||||||
// Edge-case rules (to match stable).
|
// Edge-case rules (to match stable).
|
||||||
if (type == PathType.PERFECT_CURVE && FormatVersion < LegacyBeatmapEncoder.FIRST_LAZER_VERSION)
|
if (type == PathType.PERFECT_CURVE)
|
||||||
{
|
{
|
||||||
int endPointLength = endPoint == null ? 0 : 1;
|
int endPointLength = endPoint == null ? 0 : 1;
|
||||||
|
|
||||||
if (vertices.Length + endPointLength != 3)
|
if (FormatVersion < LegacyBeatmapEncoder.FIRST_LAZER_VERSION)
|
||||||
type = PathType.BEZIER;
|
|
||||||
else if (isLinear(points[0], points[1], endPoint ?? points[2]))
|
|
||||||
{
|
{
|
||||||
// osu-stable special-cased colinear perfect curves to a linear path
|
if (vertices.Length + endPointLength != 3)
|
||||||
type = PathType.LINEAR;
|
type = PathType.BEZIER;
|
||||||
|
else if (isLinear(points[0], points[1], endPoint ?? points[2]))
|
||||||
|
{
|
||||||
|
// osu-stable special-cased colinear perfect curves to a linear path
|
||||||
|
type = PathType.LINEAR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (vertices.Length + endPointLength > 3)
|
||||||
|
// Lazer supports perfect curves with less than 3 points and colinear points
|
||||||
|
type = PathType.BEZIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The first control point must have a definite type.
|
// The first control point must have a definite type.
|
||||||
|
Loading…
Reference in New Issue
Block a user