mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 07:52:54 +08:00
Fix editor not cloning control points as expected
This commit is contained in:
parent
1aaea7011a
commit
a2cff75fc0
@ -91,7 +91,12 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
|
|
||||||
// emulate non-legacy control points by cloning the non-legacy portion.
|
// emulate non-legacy control points by cloning the non-legacy portion.
|
||||||
// the assertion is that the encoder can recreate this losslessly from hitobject data.
|
// the assertion is that the encoder can recreate this losslessly from hitobject data.
|
||||||
decoded.beatmap.ControlPointInfo = decoded.beatmap.ControlPointInfo.DeepClone();
|
var controlPointInfo = new ControlPointInfo();
|
||||||
|
|
||||||
|
foreach (var point in decoded.beatmap.ControlPointInfo.AllControlPoints)
|
||||||
|
controlPointInfo.Add(point.Time, point.DeepClone());
|
||||||
|
|
||||||
|
decoded.beatmap.ControlPointInfo = controlPointInfo;
|
||||||
|
|
||||||
Assert.AreNotEqual(typeof(LegacyControlPointInfo), decoded.beatmap.ControlPointInfo.GetType());
|
Assert.AreNotEqual(typeof(LegacyControlPointInfo), decoded.beatmap.ControlPointInfo.GetType());
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
|
|
||||||
public ControlPointInfo DeepClone()
|
public ControlPointInfo DeepClone()
|
||||||
{
|
{
|
||||||
var controlPointInfo = new ControlPointInfo();
|
var controlPointInfo = (ControlPointInfo)Activator.CreateInstance(GetType());
|
||||||
|
|
||||||
foreach (var point in AllControlPoints)
|
foreach (var point in AllControlPoints)
|
||||||
controlPointInfo.Add(point.Time, point.DeepClone());
|
controlPointInfo.Add(point.Time, point.DeepClone());
|
||||||
|
Loading…
Reference in New Issue
Block a user