diff --git a/util/lxp/cacheloop.js b/util/lxp/cacheloop.js index bde7a52..a935651 100644 --- a/util/lxp/cacheloop.js +++ b/util/lxp/cacheloop.js @@ -9,6 +9,7 @@ module.exports = async (client) => { Object.keys(client.misc.cache.lxp.xp[gxp]).forEach(user => { Monners.findOne({uid: user}).then(m => { if (!Object.keys(client.misc.cache.monners).includes(user)) {return;} + if (isNaN(client.misc.cache.monners[user])) {return;} if (!m) {m = new Monners({uid: user});} m.currency = client.misc.cache.monners[user]; m.save(); diff --git a/util/lxp/spawnchest.js b/util/lxp/spawnchest.js index 65f94ef..a6636c1 100644 --- a/util/lxp/spawnchest.js +++ b/util/lxp/spawnchest.js @@ -57,6 +57,7 @@ module.exports = async (client, member, channel, prefix) => { }); let streakBonus = streak !== 0 ? Math.floor((Math.floor(Math.random() * (rarity.amount * .10)) * 1.5 * streak)) : 0; let amount = ri.calc_bubble() + streakBonus; //calculate the amount by allowing a 10% +/- variance, higher potential with higher streak, and adding another random bonus with streak + if (isNaN(amount)) {return;} let chests = await Chests.findOne({gid: member.guild.id}); if (!chests) {return;}