mirror of
https://github.com/osukey/osukey.git
synced 2025-05-04 21:27:22 +09:00
Fix SPM calculation division by zero
This commit is contained in:
parent
e86748626a
commit
7e466e1eba
@ -35,14 +35,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
public void SetRotation(float currentRotation)
|
public void SetRotation(float currentRotation)
|
||||||
{
|
{
|
||||||
// Never calculate SPM by same time of record to avoid 0 / 0 = NaN or X / 0 = Infinity result.
|
|
||||||
if (Precision.AlmostEquals(0, Time.Elapsed))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// If we've gone back in time, it's fine to work with a fresh set of records for now
|
// If we've gone back in time, it's fine to work with a fresh set of records for now
|
||||||
if (records.Count > 0 && Time.Current < records.Last().Time)
|
if (records.Count > 0 && Time.Current < records.Last().Time)
|
||||||
records.Clear();
|
records.Clear();
|
||||||
|
|
||||||
|
// Never calculate SPM by same time of record to avoid 0 / 0 = NaN or X / 0 = Infinity result.
|
||||||
|
if (records.Count > 0 && Precision.AlmostEquals(Time.Current, records.Last().Time))
|
||||||
|
return;
|
||||||
|
|
||||||
if (records.Count > 0)
|
if (records.Count > 0)
|
||||||
{
|
{
|
||||||
var record = records.Peek();
|
var record = records.Peek();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user