From 86ed3a20a4dbf6244ac71b4c8adc02933d0154b4 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 6 Nov 2017 22:42:37 +0000 Subject: [PATCH] Beep --- commands/games/cards-against-humanity.js | 5 ++++- commands/games/wizard-convention.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/commands/games/cards-against-humanity.js b/commands/games/cards-against-humanity.js index c5da8b01..24f61293 100644 --- a/commands/games/cards-against-humanity.js +++ b/commands/games/cards-against-humanity.js @@ -34,7 +34,10 @@ module.exports = class CardsAgainstHumanityCommand extends Command { try { await msg.say('You will need at least 2 more players, at maximum 20. To join, type `join game`.'); const awaitedPlayers = await awaitPlayers(msg, 20, 3); - if (!awaitedPlayers) return msg.say('Game could not be started...'); + if (!awaitedPlayers) { + this.playing.delete(msg.channel.id); + return msg.say('Game could not be started...'); + } const players = new Map(); let i = 1; for (const player of awaitedPlayers) { diff --git a/commands/games/wizard-convention.js b/commands/games/wizard-convention.js index 94dd35d0..a7b4feb0 100644 --- a/commands/games/wizard-convention.js +++ b/commands/games/wizard-convention.js @@ -23,7 +23,10 @@ module.exports = class WizardConventionCommand extends Command { try { await msg.say('You will need at least 2 more players, at maximum 15. To join, type `join game`.'); const awaitedPlayers = await awaitPlayers(msg, 15, 3); - if (!awaitedPlayers) return msg.say('Game could not be started...'); + if (!awaitedPlayers) { + this.playing.delete(msg.channel.id); + return msg.say('Game could not be started...'); + } let roles = ['dragon', 'healer', 'mind reader']; for (let i = 0; i < (awaitedPlayers.length - 2); i++) roles.push(`pleb ${i + 1}`); roles = shuffle(roles);