Upward kicks for SRS count toward rotation limit

This commit is contained in:
Ishaan Bhardwaj
2021-02-17 14:48:35 -05:00
parent 714c6b5e99
commit 31e2529265
4 changed files with 34 additions and 27 deletions

View File

@@ -21,14 +21,15 @@ SRS.spawn_above_field = true
SRS.MANIPULATIONS_MAX = 128
function SRS:onPieceRotate(piece, grid)
function SRS:onPieceRotate(piece, grid, upward)
piece.lock_delay = 0 -- rotate reset
if piece:isDropBlocked(grid) then
if upward or piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= self.MANIPULATIONS_MAX then
piece.locked = true
end
end
end
function SRS:canPieceRotate(piece)
return piece.manipulations < self.MANIPULATIONS_MAX
end
return SRS