From 10c825a7d87e266d3261ebe72e5370ffd27c7ad5 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 13 Oct 2024 13:35:03 +0100 Subject: [PATCH] Add status removal when item changes boardElement --- public/board.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/board.js b/public/board.js index 02acb6d..7149b1b 100644 --- a/public/board.js +++ b/public/board.js @@ -478,6 +478,8 @@ class Board{ this.moveElementPositions(0, elementFrom, fromPosition, playerFrom); //console.log(JSON.stringify(boardElement)); //console.log(JSON.stringify(listPosition)); + + this.removeItemStatus(itemKey); this.drawBoard(); return 1; // Got a loop that calls a loop, and checks the new values atm, so this keeps counting down @@ -765,6 +767,10 @@ class Board{ remainingShieldCount(playerId){ return getCurrentPositionAndLength('shield', playerId)[1]; } + removeItemStatus(itemKey){ + // TODO: Remove status of card, and do/don't do effect depending on locationTo/locationFrom? + cardStatus[itemKey] = null; + } } // TODO: TEMP!! Replace soon