From 2189e3a7b8aa1d3929eb4ae3279a7e3917a9f2b6 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Wed, 10 Mar 2021 13:30:29 -0500 Subject: [PATCH] Made a previous fix to soft drop points obsolete w/ new fix --- tetris/modes/gamemode.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 839fb54..0765782 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -218,7 +218,7 @@ function GameMode:update(inputs, ruleset) if inputs["up"] == true and self.piece:isDropBlocked(self.grid) and not self.hard_drop_locked then - self:onHardDrop(math.max(piece_dy, 0)) + self:onHardDrop(piece_dy) if self.lock_on_hard_drop then self.piece_hard_dropped = true self.piece.locked = true @@ -226,7 +226,12 @@ function GameMode:update(inputs, ruleset) end if inputs["down"] == true then - self:onSoftDrop(math.max(piece_dy, 0)) + if not ( + self.piece:isDropBlocked(self.grid) and + piece_drot ~= 0 + ) then + self:onSoftDrop(piece_dy) + end if self.piece:isDropBlocked(self.grid) and not self.drop_locked and self.lock_on_soft_drop