From 2ba4a23ebffcb26e279f2f46ca2faf31c97e211c Mon Sep 17 00:00:00 2001 From: Milla Date: Thu, 11 Aug 2022 20:52:55 -0700 Subject: [PATCH] Ludicrous Speed: Fix reported PPS being higher than actual PPS --- tetris/modes/speed.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tetris/modes/speed.lua b/tetris/modes/speed.lua index c5a90fd..164383d 100644 --- a/tetris/modes/speed.lua +++ b/tetris/modes/speed.lua @@ -31,7 +31,7 @@ end local function mean(t) local sum = 0 - for _, v in ipairs(t) do + for _, v in pairs(t) do sum = sum + v end @@ -55,7 +55,7 @@ function LudicrousSpeed:getDropSpeed() return 20 end function LudicrousSpeed:getPPS() if #self.delays == 0 then return 0 end local delays = copy(self.delays) - delays[#delays + 1] = self.frames - self.last_piece + delays[0] = self.frames - self.last_piece return (mean(delays) / 60) ^ -1 end @@ -132,4 +132,4 @@ function LudicrousSpeed:getHighscoreData() } end -return LudicrousSpeed \ No newline at end of file +return LudicrousSpeed