1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 12:00:05 +08:00

Fix last control point starting new segment

This commit is contained in:
smoogipoo
2021-04-05 17:49:36 +09:00
Unverified
parent 42e816fcae
commit 4b29d0ebe2
@@ -336,9 +336,14 @@ namespace osu.Game.Rulesets.Objects.Legacy
while (++endIndex < vertices.Length - endPointLength)
{
// Keep incrementing while an implicit segment doesn't need to be started
if (vertices[endIndex].Position.Value != vertices[endIndex - 1].Position.Value)
continue;
// The last control point of each segment is not allowed to start a new implicit segment.
if (endIndex == vertices.Length - endPointLength - 1)
continue;
// Force a type on the last point, and return the current control point set as a segment.
vertices[endIndex - 1].Type.Value = type;
yield return vertices.AsMemory().Slice(startIndex, endIndex - startIndex);