From 7245991cd1bb658306c99a9995bfcb5b12674d5b Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 9 Oct 2019 01:34:34 +0200 Subject: [PATCH] don't let it go under 0 --- commands/minigame/borgar.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index 7a127e4..24437ec 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -87,13 +87,15 @@ class borgarCommand extends Command { message.reply(`u won bro,,,, that's kinda epic if i do say so myself\n**you gained ${xp} xp. you now have ${totalXP} xp**`); } } else { - let totalXP = curxp - xp; - body = {userID: message.author.id, level: level, xp: totalXP}; - if (curxp == 0) { + let totalXP; + if (curxp <= 0) { message.reply(`you failed noob... you were supposed to make **${hamIngredient}**`); + totalXP = 0; } else { message.reply(`you failed noob... you were supposed to make **${hamIngredient}**\n**you lost ${xp} xp. you now have ${totalXP} xp**`); + totalXP = curxp - xp; } + body = {userID: message.author.id, level: level, xp: totalXP}; } if (curxp == 0) {