aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2021-05-09 17:27:29 -0500
committerAnthony Wang2021-05-09 17:27:29 -0500
commitbf5f9d86b96d23c6a61a44c9cf33eb2f054342f0 (patch)
tree9ac258e89d794dd4a7eb387a423c4283d112e168
parentbc42a5bfa435cc3521db6d3c39cc38265f3ff964 (diff)
Fix bug in dealt handsv1.1.0
-rw-r--r--back/src/Game.ts3
1 files changed, 2 insertions, 1 deletions
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;