From 56e9c7f92e87bb570297475e5b8971221f74cd8a Mon Sep 17 00:00:00 2001 From: MaPePeR Date: Tue, 2 Jan 2024 21:01:35 +0100 Subject: [PATCH] Fix shrink method: Update position first so getIndicesInDirection works --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index 7ffe00b..ebda500 100644 --- a/game.js +++ b/game.js @@ -297,6 +297,7 @@ class GameState { } const shrinkFromDirection = (box) => { + updateShrink(box) for (const i of getIndicesInDirection(box)) { if (VALIDATION) { const cell = this.board[i] @@ -306,7 +307,6 @@ class GameState { } this.board[i] = null; } - updateShrink(box) for (const other of box[neighbor_param]) { swapOutEl(other[reverse_neighbor_param], box) }