From 3766149cb7d35885b08c165485fa5173351515bc Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Thu, 8 Apr 2021 11:55:36 -0400 Subject: [PATCH] Fixed a 0 ARR gravity bug --- tetris/rulesets/ruleset.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tetris/rulesets/ruleset.lua b/tetris/rulesets/ruleset.lua index d61732d..7e0e3bd 100644 --- a/tetris/rulesets/ruleset.lua +++ b/tetris/rulesets/ruleset.lua @@ -123,6 +123,7 @@ function Ruleset:movePiece(piece, grid, move, instant) local was_drop_blocked = piece:isDropBlocked(grid) local offset = ({x=0, y=0}) local moves = 0 + local y = piece.position.y if move == "left" then offset.x = -1 moves = 1 @@ -151,6 +152,9 @@ function Ruleset:movePiece(piece, grid, move, instant) if not was_drop_blocked and piece:isDropBlocked(grid) then playSE("bottom") end + if piece.position.y ~= y then + self:onPieceDrop(piece, grid) + end end function Ruleset:dropPiece(