Fix BPM multiplier not working in all cases

This commit is contained in:
smoogipoo
2021-01-12 17:50:22 +09:00
parent 22a0f99f35
commit 9a22df2b88
3 changed files with 18 additions and 300 deletions

View File

@ -164,12 +164,13 @@ namespace osu.Game.Beatmaps.Formats
/// Legacy BPM multiplier that introduces floating-point errors for rulesets that depend on it.
/// DO NOT USE THIS UNLESS 100% SURE.
/// </summary>
public float BpmMultiplier { get; private set; }
public double BpmMultiplier { get; private set; }
public LegacyDifficultyControlPoint(double beatLength)
: this()
{
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100f : 1;
// Note: In stable, the division occurs on floats, but with compiler optimisations turned on actually seems to occur on doubles via some .NET black magic (possibly inlining?).
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100.0 : 1;
}
public LegacyDifficultyControlPoint()