From 47bbc837885b7f1e6b6363a3873abfcf62c05a6d Mon Sep 17 00:00:00 2001 From: adrien Date: Wed, 10 May 2023 09:05:24 +0200 Subject: [PATCH] fix T.tSpin --- app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 07344c7..fb87dc7 100644 --- a/app.js +++ b/app.js @@ -404,14 +404,14 @@ S.prototype.minoesPosition = [ class T extends Tetromino { get tSpin() { - if (matrix.piece.lastRotation) { - let [a, b, c, d] = matrix.piece.tSlots[matrix.piece.facing] - .translate(matrix.piece.center) + if (this.lastRotation) { + let [a, b, c, d] = this.tSlots[this.facing] + .translate(this.center) .map(minoPosition => !matrix.cellIsEmpty(minoPosition)) if (a && b && (c || d)) return T_SPIN.T_SPIN else if (c && d && (a || b)) - return matrix.piece.rotationPoint5Used ? T_SPIN.T_SPIN : T_SPIN.MINI + return this.rotationPoint4Used ? T_SPIN.T_SPIN : T_SPIN.MINI } return T_SPIN.NONE }