From bf5f9d86b96d23c6a61a44c9cf33eb2f054342f0 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sun, 9 May 2021 17:27:29 -0500 Subject: [PATCH] Fix bug in dealt hands --- back/src/Game.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/back/src/Game.ts b/back/src/Game.ts index 6e0fb43..2bde1b0 100644 --- a/back/src/Game.ts +++ b/back/src/Game.ts @@ -79,7 +79,8 @@ export default class Game { [remainingCards[i], remainingCards[j]] = [remainingCards[j], remainingCards[i]]; } for (let i = 0; i < this.room.clients.length; ++i) - this.players[i].cards = remainingCards.slice(i*(handSize-2), (i+1)*(handSize-2)); + for (let j = 0; j < handSize-2; ++j) + this.players[i].cards.push(remainingCards[i*(handSize-2)+j]); const startingPlayer = this.players[0]; // Pick a random starting player instead?? this.playerTurn = this.players.indexOf(startingPlayer); this.playersFinished = this.room.clients.length;