From b6f4158d70d67155a2c0332e65eed10b921fc1c6 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Fri, 4 Dec 2020 16:51:53 -0500 Subject: [PATCH] Fixed SRS infinity bug! --- tetris/rulesets/arika_srs.lua | 2 +- tetris/rulesets/standard_exp.lua | 2 +- tetris/rulesets/ti_srs.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tetris/rulesets/arika_srs.lua b/tetris/rulesets/arika_srs.lua index 5777b77..f72c715 100755 --- a/tetris/rulesets/arika_srs.lua +++ b/tetris/rulesets/arika_srs.lua @@ -147,9 +147,9 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid) for idx, offset in pairs(kicks) do kicked_piece = new_piece:withOffset(offset) if grid:canPlacePiece(kicked_piece) then + self:onPieceRotate(piece, grid) piece:setRelativeRotation(rot_dir) piece:setOffset(offset) - self:onPieceRotate(piece, grid) return end end diff --git a/tetris/rulesets/standard_exp.lua b/tetris/rulesets/standard_exp.lua index 601f614..a4975ba 100755 --- a/tetris/rulesets/standard_exp.lua +++ b/tetris/rulesets/standard_exp.lua @@ -159,9 +159,9 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid) for idx, offset in pairs(kicks) do kicked_piece = new_piece:withOffset(offset) if grid:canPlacePiece(kicked_piece) then + self:onPieceRotate(piece, grid) piece:setRelativeRotation(rot_dir) piece:setOffset(offset) - self:onPieceRotate(piece, grid) return end end diff --git a/tetris/rulesets/ti_srs.lua b/tetris/rulesets/ti_srs.lua index 6f79f34..130d8fa 100644 --- a/tetris/rulesets/ti_srs.lua +++ b/tetris/rulesets/ti_srs.lua @@ -147,9 +147,9 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid) for idx, offset in pairs(kicks) do kicked_piece = new_piece:withOffset(offset) if grid:canPlacePiece(kicked_piece) then + self:onPieceRotate(piece, grid) piece:setRelativeRotation(rot_dir) piece:setOffset(offset) - self:onPieceRotate(piece, grid) return end end