mirror of
https://github.com/ppy/osu.git
synced 2025-01-29 06:33:21 +08:00
Default to linear control point type
This commit is contained in:
parent
5a093c039c
commit
9cb649436c
@ -196,9 +196,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
if (ControlPoints.Count == 0)
|
if (ControlPoints.Count == 0)
|
||||||
return;
|
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];
|
Vector2[] vertices = new Vector2[ControlPoints.Count];
|
||||||
for (int i = 0; i < ControlPoints.Count; i++)
|
for (int i = 0; i < ControlPoints.Count; i++)
|
||||||
vertices[i] = ControlPoints[i].Position.Value;
|
vertices[i] = ControlPoints[i].Position.Value;
|
||||||
@ -214,7 +211,7 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
|
|
||||||
// The current vertex ends the segment
|
// The current vertex ends the segment
|
||||||
var segmentVertices = vertices.AsSpan().Slice(start, i - start + 1);
|
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))
|
foreach (Vector2 t in computeSubPath(segmentVertices, segmentType))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user