From 5a074f77cf1b8bfee6fba010f614c0909206decf Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Wed, 3 Feb 2021 16:50:03 -0500 Subject: [PATCH] Adjusted how DAS cut subtracts from the counter --- funcs.lua | 12 ++++++++---- tetris/modes/gamemode.lua | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/funcs.lua b/funcs.lua index 5f5f1c7..7c017ce 100644 --- a/funcs.lua +++ b/funcs.lua @@ -80,9 +80,13 @@ end function table.contains(table, element) for _, value in pairs(table) do - if value == element then - return true - end + if value == element then + return true + end end return false - end \ No newline at end of file +end + +function clamp(a, b, c) + return math.min(a, math.max(b, c)) +end \ No newline at end of file diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 5c87e67..7e0f67d 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -207,7 +207,7 @@ function GameMode:update(inputs, ruleset) ) then self.das.frames = math.max( self.das.frames - self:getDasCutDelay(), - -self:getDasCutDelay() + -(self:getDasCutDelay() + 1) ) end