From b1d325b7140bb80868b1521583912c6e459021a1 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Tue, 9 Mar 2021 16:35:57 -0500 Subject: [PATCH] Fixed negative soft drop and hard drop points again For finer control of piece drops, use GameMode:onPieceDrop --- tetris/modes/gamemode.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index c4510a5..839fb54 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(piece_dy) + self:onHardDrop(math.max(piece_dy, 0)) if self.lock_on_hard_drop then self.piece_hard_dropped = true self.piece.locked = true @@ -226,7 +226,7 @@ function GameMode:update(inputs, ruleset) end if inputs["down"] == true then - self:onSoftDrop(piece_dy) + self:onSoftDrop(math.max(piece_dy, 0)) if self.piece:isDropBlocked(self.grid) and not self.drop_locked and self.lock_on_soft_drop