Fix bug in dealt hands

This commit is contained in:
Anthony Wang 2021-05-09 17:27:29 -05:00
parent bc42a5bfa4
commit bf5f9d86b9
Signed by: a
GPG key ID: 6FD3502572299774

View file

@ -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;