mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:18:22 +08:00
Merge pull request #25006 from smoogipoo/fix-spinner-precision
Fix spinner requirements being susceptible to FP precision
This commit is contained in:
commit
66824ce8ca
@ -70,8 +70,11 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
double secondsDuration = Duration / 1000;
|
double secondsDuration = Duration / 1000;
|
||||||
|
|
||||||
SpinsRequired = (int)(minRps * secondsDuration);
|
// Allow a 0.1ms floating point precision error in the calculation of the duration.
|
||||||
MaximumBonusSpins = Math.Max(0, (int)(maxRps * secondsDuration) - SpinsRequired - bonus_spins_gap);
|
const double duration_error = 0.0001;
|
||||||
|
|
||||||
|
SpinsRequired = (int)(minRps * secondsDuration + duration_error);
|
||||||
|
MaximumBonusSpins = Math.Max(0, (int)(maxRps * secondsDuration + duration_error) - SpinsRequired - bonus_spins_gap);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
||||||
|
Loading…
Reference in New Issue
Block a user