Open sangyoo91 opened 3 years ago
Upon looking further into this, I think table.showdown
pots.eligiblePlayers
doesn't consider player fold state.
I think this is fixed. Please test it out and if it still happens then bring me back some steps to reproduce and I'll tackle it :)
I made my own fixes locally for this, but I'll test it out.
Mind sharing those fixes? :sweat_smile:
I've strayed away from the project, but if I remember properly it was
// Distribute pots and mark winners.
this.pots.forEach(pot => {
pot.winners = findWinners(pot.eligiblePlayers);
const award = pot.amount / pot.winners!.length;
pot.winners!.forEach(player => player.stackSize += award);
});
This part that was the problem.
I don't use type script but I believe I did
pot.winners = findWinners( pot.eligiblePlayers.filter((p)=> {
return !p.folded
}) );
On a local js build I did. Hope this helps :D
I found an error where when everyone folds, the pot goes to the highest hand even if the player has folded.
The pot should go to the one person who didnt fold .
table.winners shows the proper winner, but the chips go to the person with the actual highest hand