From 6b4c954010bd7528df1cc7b3f09a40df9df078e6 Mon Sep 17 00:00:00 2001 From: hppeng Date: Sat, 23 Jul 2022 23:10:19 -0700 Subject: [PATCH] HOTFIX: patch custom parsing/saving renamed types -> all_types --- js/custom.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/custom.js b/js/custom.js index 8c712af..4a6e94c 100644 --- a/js/custom.js +++ b/js/custom.js @@ -65,7 +65,7 @@ function encodeCustom(custom, verbose) { if (typeof (val) === "string" && val !== "") { if ((damages.includes(id) && val === "0-0") || (!verbose && ["lore", "majorIds", "quest", "materials", "drop", "set"].includes(id))) { continue; } if (id === "type") { - hash += Base64.fromIntN(i, 2) + Base64.fromIntN(types.indexOf(val.substring(0, 1).toUpperCase() + val.slice(1)), 1); + hash += Base64.fromIntN(i, 2) + Base64.fromIntN(all_types.indexOf(val.substring(0, 1).toUpperCase() + val.slice(1)), 1); } else if (id === "tier") { hash += Base64.fromIntN(i, 2) + Base64.fromIntN(tiers.indexOf(val), 1); } else if (id === "atkSpd") { @@ -147,7 +147,7 @@ function getCustomFromHash(hash) { val = tiers[Base64.toInt(tag.charAt(2))]; len = -1; } else if (id === "type") { - val = types[Base64.toInt(tag.charAt(2))]; + val = all_types[Base64.toInt(tag.charAt(2))]; len = -1; } else if (id === "atkSpd") { val = attackSpeeds[Base64.toInt(tag.charAt(2))]; @@ -179,7 +179,8 @@ function getCustomFromHash(hash) { return new Custom(statMap); } } catch (error) { - //console.log(statMap); + console.log(error); + console.log(statMap); return undefined; }