1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Default to linear control point type

This commit is contained in:
smoogipoo 2019-12-09 17:47:05 +09:00
parent 5a093c039c
commit 9cb649436c

View File

@ -196,9 +196,6 @@ namespace osu.Game.Rulesets.Objects
if (ControlPoints.Count == 0)
return;
if (ControlPoints[0].Type.Value == null)
throw new InvalidOperationException($"The first control point in a {nameof(SliderPath)} must have a non-null type.");
Vector2[] vertices = new Vector2[ControlPoints.Count];
for (int i = 0; i < ControlPoints.Count; i++)
vertices[i] = ControlPoints[i].Position.Value;
@ -214,7 +211,7 @@ namespace osu.Game.Rulesets.Objects
// The current vertex ends the segment
var segmentVertices = vertices.AsSpan().Slice(start, i - start + 1);
var segmentType = ControlPoints[start].Type.Value.Value;
var segmentType = ControlPoints[start].Type.Value ?? PathType.Linear;
foreach (Vector2 t in computeSubPath(segmentVertices, segmentType))
{