Fix bug in dealt hands
This commit is contained in:
parent
bc42a5bfa4
commit
bf5f9d86b9
1 changed files with 2 additions and 1 deletions
|
@ -79,7 +79,8 @@ export default class Game {
|
||||||
[remainingCards[i], remainingCards[j]] = [remainingCards[j], remainingCards[i]];
|
[remainingCards[i], remainingCards[j]] = [remainingCards[j], remainingCards[i]];
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.room.clients.length; ++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??
|
const startingPlayer = this.players[0]; // Pick a random starting player instead??
|
||||||
this.playerTurn = this.players.indexOf(startingPlayer);
|
this.playerTurn = this.players.indexOf(startingPlayer);
|
||||||
this.playersFinished = this.room.clients.length;
|
this.playersFinished = this.room.clients.length;
|
||||||
|
|
Loading…
Reference in a new issue