mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Throw rather than ignore on invalid control point addition
This commit is contained in:
parent
ce197b6322
commit
eabca016d4
@ -276,6 +276,9 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
case EffectControlPoint typed:
|
case EffectControlPoint typed:
|
||||||
effectPoints.Add(typed);
|
effectPoints.Add(typed);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new ArgumentException($"A control point of unexpected type {controlPoint.GetType()} was added to this {nameof(ControlPointInfo)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,14 +73,16 @@ namespace osu.Game.Beatmaps.Legacy
|
|||||||
{
|
{
|
||||||
case SampleControlPoint typed:
|
case SampleControlPoint typed:
|
||||||
samplePoints.Add(typed);
|
samplePoints.Add(typed);
|
||||||
break;
|
return;
|
||||||
|
|
||||||
case DifficultyControlPoint typed:
|
case DifficultyControlPoint typed:
|
||||||
difficultyPoints.Add(typed);
|
difficultyPoints.Add(typed);
|
||||||
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
base.GroupItemAdded(controlPoint);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
base.GroupItemAdded(controlPoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void GroupItemRemoved(ControlPoint controlPoint)
|
protected override void GroupItemRemoved(ControlPoint controlPoint)
|
||||||
|
Loading…
Reference in New Issue
Block a user