1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 07:04:15 +08:00

Fix crashes when manually creating sliders

This commit is contained in:
smoogipoo 2018-10-16 18:27:09 +09:00
parent 47be95ce0b
commit e8ce5a7e6c

View File

@ -130,7 +130,7 @@ namespace osu.Game.Rulesets.Osu.Objects
{
StartTime = StartTime,
Position = Position,
Samples = NodeSamples[0],
Samples = getNodeSamples(0),
SampleControlPoint = SampleControlPoint,
IndexInCurrentCombo = IndexInCurrentCombo,
ComboIndex = ComboIndex,
@ -210,11 +210,18 @@ namespace osu.Game.Rulesets.Osu.Objects
Position = Position + Curve.PositionAt(repeat % 2),
StackHeight = StackHeight,
Scale = Scale,
Samples = new List<SampleInfo>(NodeSamples[1 + repeatIndex])
Samples = getNodeSamples(1 + repeatIndex)
});
}
}
private List<SampleInfo> getNodeSamples(int nodeIndex)
{
if (nodeIndex < NodeSamples.Count)
return NodeSamples[nodeIndex];
return Samples;
}
public override Judgement CreateJudgement() => new OsuJudgement();
}
}