mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Fix
This commit is contained in:
@@ -35,6 +35,7 @@ module.exports = class MinesweeperCommand extends Command {
|
|||||||
game.onWin = () => { win = true; };
|
game.onWin = () => { win = true; };
|
||||||
game.onLoss = () => { win = false; };
|
game.onLoss = () => { win = false; };
|
||||||
while (!win) {
|
while (!win) {
|
||||||
|
if (win === true || win === false) break;
|
||||||
await msg.say(stripIndents`
|
await msg.say(stripIndents`
|
||||||
${msg.author}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit.
|
${msg.author}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit.
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ module.exports = class MinesweeperCommand extends Command {
|
|||||||
game.CheckCell(x - 1, y - 1);
|
game.CheckCell(x - 1, y - 1);
|
||||||
}
|
}
|
||||||
this.client.games.delete(msg.channel.id);
|
this.client.games.delete(msg.channel.id);
|
||||||
if (!win) return msg.say('Game ended due to inactivity.');
|
if (win === null) return msg.say('Game ended due to inactivity.');
|
||||||
return msg.say(stripIndents`
|
return msg.say(stripIndents`
|
||||||
${win ? 'Nice job! You win!' : 'Sorry... You lose.'}
|
${win ? 'Nice job! You win!' : 'Sorry... You lose.'}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user