From 2075ec2b91cd680829ecf3e36eac62db982ca6df Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 24 Nov 2020 17:02:59 -0500 Subject: [PATCH] Fix --- commands/games-mp/poker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/games-mp/poker.js b/commands/games-mp/poker.js index cb4c47a5..5f2b9d2d 100644 --- a/commands/games-mp/poker.js +++ b/commands/games-mp/poker.js @@ -3,7 +3,7 @@ const Collection = require('@discordjs/collection'); const { Hand } = require('pokersolver'); const { stripIndents } = require('common-tags'); const Deck = require('../../structures/cards/Deck'); -const { formatNumber, list, delay, awaitPlayers } = require('../../util/Util'); +const { formatNumber, list, delay, awaitPlayers, removeFromArray } = require('../../util/Util'); const max = 6; const min = 2; const bigBlindAmount = 100; @@ -67,6 +67,10 @@ module.exports = class PokerCommand extends Command { let winner = null; let rotation = players.map(p => p.id); while (!winner) { + for (const player of players.values()) { + if (players.has(player.id)) continue; + rotation = removeFromArray(player.id); + } const bigBlind = players.get(rotation[1]); bigBlind.money -= bigBlindAmount; bigBlind.currentBet += bigBlindAmount;