Fix error when playing card from hand

When opponent has hand in same position.
Added playerId to check
develop
Nathan Steel 1 year ago
parent 64a6a3ca85
commit b86e41c010

@ -570,7 +570,7 @@ class Board{
return false; return false;
} }
let itemKey = this.getItemKey(fromElement, positionFrom); let itemKey = this.getItemKey(fromElement, positionFrom, fromPlayer);
console.log(itemKey); console.log(itemKey);
console.log(positionFrom); console.log(positionFrom);
@ -608,8 +608,8 @@ class Board{
this.drawBoard(); this.drawBoard();
} }
getItemKey(boardElementId, listPositionId){ getItemKey(boardElementId, listPositionId, playerFrom){
let itemKey = this.getItems(boardElementId, null, null, listPositionId); let itemKey = this.getItems(boardElementId, playerFrom, null, listPositionId);
if(itemKey.length < 1){ if(itemKey.length < 1){
alert('Could not find key'); alert('Could not find key');
return false; return false;

Loading…
Cancel
Save