Use BigInt for correct ship math

This commit is contained in:
Dragon Fire
2020-04-17 19:06:52 -04:00
parent 35f868768b
commit bf3a3162df
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ module.exports = class ShipCommand extends Command {
async run(msg, { first, second }) {
if (first.id === second.id) return msg.reply('Shipping someone with themselves would be pretty weird.');
const random = MersenneTwister19937.seed(Math.abs(first.id - second.id));
const calculated = Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
const random = MersenneTwister19937.seed(calculated);
const level = integer(0, 100)(random);
const firstAvatarURL = first.displayAvatarURL({ format: 'png', size: 512 });
const secondAvatarURL = second.displayAvatarURL({ format: 'png', size: 512 });
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "113.0.4",
"version": "113.0.5",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {