Add back autogeneration rules

Will be removed in https://github.com/ppy/osu/pull/6604
This commit is contained in:
Dean Herbert
2019-10-26 10:25:13 +09:00
parent 7100319858
commit d6a49b9e93
3 changed files with 16 additions and 12 deletions

View File

@ -30,10 +30,19 @@ namespace osu.Game.Beatmaps.ControlPoints
public void Add(ControlPoint point)
{
point.AttachGroup(this);
var existing = controlPoints.FirstOrDefault(p => p.GetType() == point.GetType());
if (existing != null)
{
// autogenerated points should not replace non-autogenerated.
// this allows for incorrectly ordered timing points to still be correctly handled.
if (point.AutoGenerated && !existing.AutoGenerated)
return;
foreach (var existing in controlPoints.Where(p => p.GetType() == point.GetType()).ToArray())
Remove(existing);
}
point.AttachGroup(this);
controlPoints.Add(point);
ItemAdded?.Invoke(point);