From 0ccb65b1a31ac3a4e01b31c3d150ba3e7aeff77d Mon Sep 17 00:00:00 2001 From: Nathan Date: Mon, 14 Oct 2024 20:56:02 +0100 Subject: [PATCH] Fix wrong cards added to deck --- public/board.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/board.js b/public/board.js index 3051e48..c4d90d5 100644 --- a/public/board.js +++ b/public/board.js @@ -1087,8 +1087,9 @@ function createDeckList(playerId){ item.push(itemCount); // Set card data for new item // Use the ID from the deckList of player, and return the card of that ID from cardList/DB - // ID 1 was adding id 0 as array index. Changed to +1 for now (will correct in DB form) - cardData[itemCount] = cardArray[deckList[deckItem]+1]; + // For now, needs to be -1, as ID1 in decklist refers to ID 1 of carlist which is INDEX 0 + // TODO: Make it use the cardList ID, not the index + cardData[itemCount] = cardArray[deckList[deckItem]-1]; // Set to base position of 'deck' boardElement[itemCount] = 'deck'; // Set Attack, ManaCost, ManaColours TODO: When these are implemented seperately