mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Merge pull request #1362 from peppy/fix-spm-queue
Fix potential read from empty queue in SPM counter
This commit is contained in:
commit
78a4045154
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
if (records.Count > 0)
|
if (records.Count > 0)
|
||||||
{
|
{
|
||||||
var record = records.Peek();
|
var record = records.Peek();
|
||||||
while (Time.Current - records.Peek().Time > spm_count_duration)
|
while (records.Count > 0 && Time.Current - records.Peek().Time > spm_count_duration)
|
||||||
record = records.Dequeue();
|
record = records.Dequeue();
|
||||||
SpinsPerMinute = (currentRotation - record.Rotation) / (Time.Current - record.Time) * 1000 * 60 / 360;
|
SpinsPerMinute = (currentRotation - record.Rotation) / (Time.Current - record.Time) * 1000 * 60 / 360;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user