From b86e41c01031523decc610392ea0dd3894a70ab8 Mon Sep 17 00:00:00 2001 From: Nathan Date: Mon, 14 Oct 2024 19:02:42 +0100 Subject: [PATCH] Fix error when playing card from hand When opponent has hand in same position. Added playerId to check --- public/board.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/board.js b/public/board.js index ed89090..3f474cb 100644 --- a/public/board.js +++ b/public/board.js @@ -570,7 +570,7 @@ class Board{ return false; } - let itemKey = this.getItemKey(fromElement, positionFrom); + let itemKey = this.getItemKey(fromElement, positionFrom, fromPlayer); console.log(itemKey); console.log(positionFrom); @@ -608,8 +608,8 @@ class Board{ this.drawBoard(); } - getItemKey(boardElementId, listPositionId){ - let itemKey = this.getItems(boardElementId, null, null, listPositionId); + getItemKey(boardElementId, listPositionId, playerFrom){ + let itemKey = this.getItems(boardElementId, playerFrom, null, listPositionId); if(itemKey.length < 1){ alert('Could not find key'); return false;