Add bare minimum sanity checking of beatmap input values to make broken maps load

Resolves ppy/osu#1988.
This commit is contained in:
Dean Herbert
2018-02-28 18:12:24 +09:00
parent 968291c61e
commit 5b4fef0180
3 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
@ -29,7 +30,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
Position = position,
NewCombo = newCombo,
ControlPoints = controlPoints,
Distance = length,
Distance = Math.Max(0, length),
CurveType = curveType,
RepeatSamples = repeatSamples,
RepeatCount = repeatCount