Fix instability of taiko double conversion

Until now, the taiko speed multiplier was potentially applied more than
once if conversion was run multiple times.
This commit is contained in:
Dean Herbert
2021-08-30 15:30:17 +09:00
parent 4adfe9a6dc
commit 6a6dac609c
2 changed files with 32 additions and 5 deletions

View File

@ -32,7 +32,23 @@ namespace osu.Game.Beatmaps
/// <summary>
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
/// </summary>
public BeatmapDifficulty Clone() => (BeatmapDifficulty)MemberwiseClone();
public BeatmapDifficulty Clone()
{
var diff = new BeatmapDifficulty();
CopyTo(diff);
return diff;
}
public void CopyTo(BeatmapDifficulty difficulty)
{
difficulty.ApproachRate = ApproachRate;
difficulty.DrainRate = DrainRate;
difficulty.CircleSize = CircleSize;
difficulty.OverallDifficulty = OverallDifficulty;
difficulty.SliderMultiplier = SliderMultiplier;
difficulty.SliderTickRate = SliderTickRate;
}
/// <summary>
/// Maps a difficulty value [0, 10] to a two-piece linear range of values.