From ee9bcc5039864b75230dfe31c76f77728bb2b6ed Mon Sep 17 00:00:00 2001 From: "PolicyChanges1@gmail.com" Date: Wed, 10 Mar 2021 21:05:51 -0500 Subject: [PATCH] dunno2 --- dist/tetrion.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dist/tetrion.js b/dist/tetrion.js index b37e80b..b371fb0 100644 --- a/dist/tetrion.js +++ b/dist/tetrion.js @@ -1305,15 +1305,17 @@ Tetris.prototype = { side4X = tPiece.x + 2; side4Y = tPiece.y + 2; - if(matrix[side1Y][side1X] != 0) - side1 = 1; - if(matrix[side2Y][side2X] != 0) - side2 = 1; - // TODO: figure out why this occasionally is undefined - if(matrix[side3Y] != undefined && matrix[side3Y][side3X] != 0) - side3 = 1; - if(matrix[side4Y][side4X] != 0) - side4 = 1; + if(matrix[side4Y] != undefined && matrix[side3Y] != undefined) { + if(matrix[side1Y][side1X] != 0) + side1 = 1; + if(matrix[side2Y][side2X] != 0) + side2 = 1; + // TODO: figure out why this occasionally is undefined + if(matrix[side3Y][side3X] != 0) + side3 = 1; + if(matrix[side4Y][side4X] != 0) + side4 = 1; + } console.log("sides: " + side1+side2+side3+side4); // if Sides A and B + (C or D) are touching a Surface