Fixed a 0 ARR gravity bug

pull/17/head
Ishaan Bhardwaj 2021-04-08 11:55:36 -04:00
parent 449ca16bc4
commit 3766149cb7
1 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,7 @@ function Ruleset:movePiece(piece, grid, move, instant)
local was_drop_blocked = piece:isDropBlocked(grid) local was_drop_blocked = piece:isDropBlocked(grid)
local offset = ({x=0, y=0}) local offset = ({x=0, y=0})
local moves = 0 local moves = 0
local y = piece.position.y
if move == "left" then if move == "left" then
offset.x = -1 offset.x = -1
moves = 1 moves = 1
@ -151,6 +152,9 @@ function Ruleset:movePiece(piece, grid, move, instant)
if not was_drop_blocked and piece:isDropBlocked(grid) then if not was_drop_blocked and piece:isDropBlocked(grid) then
playSE("bottom") playSE("bottom")
end end
if piece.position.y ~= y then
self:onPieceDrop(piece, grid)
end
end end
function Ruleset:dropPiece( function Ruleset:dropPiece(