mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 09:20:02 +09:00
Fix control points with same timestamp potentially being parsed incorrectly
This commit is contained in:
@ -12,6 +12,11 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double Time;
|
public double Time;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this timing point was generated internally, as opposed to parsed from the underlying beatmap.
|
||||||
|
/// </summary>
|
||||||
|
internal bool AutoGenerated;
|
||||||
|
|
||||||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -374,14 +374,16 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
handleDifficultyControlPoint(new DifficultyControlPoint
|
handleDifficultyControlPoint(new DifficultyControlPoint
|
||||||
{
|
{
|
||||||
Time = time,
|
Time = time,
|
||||||
SpeedMultiplier = speedMultiplier
|
SpeedMultiplier = speedMultiplier,
|
||||||
|
AutoGenerated = timingChange
|
||||||
});
|
});
|
||||||
|
|
||||||
handleEffectControlPoint(new EffectControlPoint
|
handleEffectControlPoint(new EffectControlPoint
|
||||||
{
|
{
|
||||||
Time = time,
|
Time = time,
|
||||||
KiaiMode = kiaiMode,
|
KiaiMode = kiaiMode,
|
||||||
OmitFirstBarLine = omitFirstBarSignature
|
OmitFirstBarLine = omitFirstBarSignature,
|
||||||
|
AutoGenerated = timingChange
|
||||||
});
|
});
|
||||||
|
|
||||||
handleSampleControlPoint(new LegacySampleControlPoint
|
handleSampleControlPoint(new LegacySampleControlPoint
|
||||||
@ -389,7 +391,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
Time = time,
|
Time = time,
|
||||||
SampleBank = stringSampleSet,
|
SampleBank = stringSampleSet,
|
||||||
SampleVolume = sampleVolume,
|
SampleVolume = sampleVolume,
|
||||||
CustomSampleBank = customSampleBank
|
CustomSampleBank = customSampleBank,
|
||||||
|
AutoGenerated = timingChange
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
@ -419,6 +422,11 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
if (newPoint.EquivalentTo(existing))
|
if (newPoint.EquivalentTo(existing))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// autogenerated points should not replace non-autogenerated.
|
||||||
|
// this allows for incorrectly ordered timing points to still be correctly handled.
|
||||||
|
if (newPoint.AutoGenerated && !existing.AutoGenerated)
|
||||||
|
return;
|
||||||
|
|
||||||
if (existing.Time == newPoint.Time)
|
if (existing.Time == newPoint.Time)
|
||||||
beatmap.ControlPointInfo.DifficultyPoints.Remove(existing);
|
beatmap.ControlPointInfo.DifficultyPoints.Remove(existing);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user