From a8beea127b01eaa7e3f147aa3e06b4968d11ee73 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 16 Jun 2019 13:39:20 -0400 Subject: [PATCH] Fix stuck game if sorting-hat runs out of time --- commands/games/sorting-hat.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/games/sorting-hat.js b/commands/games/sorting-hat.js index 50630143..d501e64f 100644 --- a/commands/games/sorting-hat.js +++ b/commands/games/sorting-hat.js @@ -63,7 +63,10 @@ module.exports = class SortingHatCommand extends Command { max: 1, time: 120000 }); - if (!choice.size) return msg.say('Oh no, you ran out of time! Too bad.'); + if (!choice.size) { + this.client.games.delete(msg.channel.id); + return msg.say('Oh no, you ran out of time! Too bad.'); + } const answer = answers[choices.indexOf(choice.first().content.toUpperCase())]; for (const [house, amount] of Object.entries(answer.points)) points[house] += amount; ++turn; diff --git a/package.json b/package.json index e3d62d9d..6ca78633 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "106.0.0", + "version": "106.0.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {