From fd7c8b657c358322ecbd9a19515b53a32ab7fda0 Mon Sep 17 00:00:00 2001 From: Lawin0129 <56766256+Lawin0129@users.noreply.github.com> Date: Sun, 13 Feb 2022 00:48:36 +0000 Subject: [PATCH] Fix chapter 1 season 4 and 5 crash --- index.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 38f09a8..7e70b3d 100644 --- a/index.js +++ b/index.js @@ -24,17 +24,20 @@ axios.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => { }) } - athena.items[id] = { - "templateId": id, - "attributes": { - "max_level_bonus": 0, - "level": 1, - "item_seen": true, - "xp": 0, - "variants": variants, - "favorite": false - }, - "quantity": 1 + // Dont add anything that includes "random" in the id (Chapter 1 Season 4 and 5 crash fix) + if (!item.id.toLowerCase().includes("random")) { + athena.items[id] = { + "templateId": id, + "attributes": { + "max_level_bonus": 0, + "level": 1, + "item_seen": true, + "xp": 0, + "variants": variants, + "favorite": false + }, + "quantity": 1 + } } }) @@ -58,4 +61,4 @@ function size(bytes) { } return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i] -} \ No newline at end of file +}