Standard SRS now has correct amount of move resets

This commit is contained in:
Ishaan Bhardwaj 2021-01-28 21:19:47 -05:00
parent e8904b92ed
commit e19da98ea1

View File

@ -10,6 +10,25 @@ SRS.harddrop_lock = true
SRS.MANIPULATIONS_MAX = 15
function SRS:onPieceDrop(piece, grid)
self:checkNewLow(piece)
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then
piece.locked = true
else
piece.lock_delay = 0 -- step reset
end
end
function SRS:onPieceMove(piece, grid)
piece.lock_delay = 0 -- move reset
if piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= SRS.MANIPULATIONS_MAX then
piece.locked = true
end
end
end
function SRS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset
self:checkNewLow(piece)