Skip to content

Commit 292fd34

Browse files
authored
Merge pull request #22302 from ekrctb/fix-infinity-spm
Fix spinners potentially displaying incorrect SPM numbers
2 parents c2e1c91 + ce64ba4 commit 292fd34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

osu.Game.Rulesets.Osu/Skinning/Default/SpinnerSpmCalculator.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ protected override void LoadComplete()
3535

3636
public void SetRotation(float currentRotation)
3737
{
38-
// Never calculate SPM by same time of record to avoid 0 / 0 = NaN or X / 0 = Infinity result.
39-
if (Precision.AlmostEquals(0, Time.Elapsed))
40-
return;
41-
4238
// If we've gone back in time, it's fine to work with a fresh set of records for now
4339
if (records.Count > 0 && Time.Current < records.Last().Time)
4440
records.Clear();
4541

42+
// Never calculate SPM by same time of record to avoid 0 / 0 = NaN or X / 0 = Infinity result.
43+
if (records.Count > 0 && Precision.AlmostEquals(Time.Current, records.Last().Time))
44+
return;
45+
4646
if (records.Count > 0)
4747
{
4848
var record = records.Peek();

0 commit comments

Comments
 (0)