Fixed negative soft drop and hard drop points again

For finer control of piece drops, use GameMode:onPieceDrop
This commit is contained in:
Ishaan Bhardwaj 2021-03-09 16:35:57 -05:00
parent 4ab5e3747a
commit b1d325b714

View File

@ -218,7 +218,7 @@ function GameMode:update(inputs, ruleset)
if inputs["up"] == true and if inputs["up"] == true and
self.piece:isDropBlocked(self.grid) and self.piece:isDropBlocked(self.grid) and
not self.hard_drop_locked then not self.hard_drop_locked then
self:onHardDrop(piece_dy) self:onHardDrop(math.max(piece_dy, 0))
if self.lock_on_hard_drop then if self.lock_on_hard_drop then
self.piece_hard_dropped = true self.piece_hard_dropped = true
self.piece.locked = true self.piece.locked = true
@ -226,7 +226,7 @@ function GameMode:update(inputs, ruleset)
end end
if inputs["down"] == true then if inputs["down"] == true then
self:onSoftDrop(piece_dy) self:onSoftDrop(math.max(piece_dy, 0))
if self.piece:isDropBlocked(self.grid) and if self.piece:isDropBlocked(self.grid) and
not self.drop_locked and not self.drop_locked and
self.lock_on_soft_drop self.lock_on_soft_drop