mirror of https://github.com/ppy/osu
Merge pull request #3217 from smoogipoo/fix-samples
Fix new control points with same start time not replacing existing ones
This commit is contained in:
commit
da01501a1c
|
@ -354,6 +354,11 @@ private void handleTimingPoint(string line)
|
||||||
|
|
||||||
private void handleTimingControlPoint(TimingControlPoint newPoint)
|
private void handleTimingControlPoint(TimingControlPoint newPoint)
|
||||||
{
|
{
|
||||||
|
var existing = beatmap.ControlPointInfo.TimingPointAt(newPoint.Time);
|
||||||
|
|
||||||
|
if (existing.Time == newPoint.Time)
|
||||||
|
beatmap.ControlPointInfo.TimingPoints.Remove(existing);
|
||||||
|
|
||||||
beatmap.ControlPointInfo.TimingPoints.Add(newPoint);
|
beatmap.ControlPointInfo.TimingPoints.Add(newPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +369,9 @@ private void handleDifficultyControlPoint(DifficultyControlPoint newPoint)
|
||||||
if (newPoint.EquivalentTo(existing))
|
if (newPoint.EquivalentTo(existing))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
beatmap.ControlPointInfo.DifficultyPoints.RemoveAll(x => x.Time == newPoint.Time);
|
if (existing.Time == newPoint.Time)
|
||||||
|
beatmap.ControlPointInfo.DifficultyPoints.Remove(existing);
|
||||||
|
|
||||||
beatmap.ControlPointInfo.DifficultyPoints.Add(newPoint);
|
beatmap.ControlPointInfo.DifficultyPoints.Add(newPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,6 +382,9 @@ private void handleEffectControlPoint(EffectControlPoint newPoint)
|
||||||
if (newPoint.EquivalentTo(existing))
|
if (newPoint.EquivalentTo(existing))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (existing.Time == newPoint.Time)
|
||||||
|
beatmap.ControlPointInfo.EffectPoints.Remove(existing);
|
||||||
|
|
||||||
beatmap.ControlPointInfo.EffectPoints.Add(newPoint);
|
beatmap.ControlPointInfo.EffectPoints.Add(newPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,6 +395,9 @@ private void handleSampleControlPoint(SampleControlPoint newPoint)
|
||||||
if (newPoint.EquivalentTo(existing))
|
if (newPoint.EquivalentTo(existing))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (existing.Time == newPoint.Time)
|
||||||
|
beatmap.ControlPointInfo.SamplePoints.Remove(existing);
|
||||||
|
|
||||||
beatmap.ControlPointInfo.SamplePoints.Add(newPoint);
|
beatmap.ControlPointInfo.SamplePoints.Add(newPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue