From 0b12daa9681cedf1b3a4aa6815735993098b6fdb Mon Sep 17 00:00:00 2001 From: b Date: Sun, 14 Feb 2021 17:33:37 -0600 Subject: [PATCH] Fix crafted skillpoint (2) --- builder.js | 2 +- skillpoints.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builder.js b/builder.js index 9bd9b24..f728cf1 100644 --- a/builder.js +++ b/builder.js @@ -2,7 +2,7 @@ const url_tag = location.hash.slice(1); console.log(url_base); console.log(url_tag); -const BUILD_VERSION = "6.9.27"; +const BUILD_VERSION = "6.9.28"; function setTitle() { let text; diff --git a/skillpoints.js b/skillpoints.js index 5213ee0..6559783 100644 --- a/skillpoints.js +++ b/skillpoints.js @@ -8,12 +8,12 @@ function calculate_skillpoints(equipment, weapon) { let crafted = []; //console.log(equipment); for (const item of equipment) { - if (item.get("reqs").every(x => x === 0)) { - fixed.push(item); - } - else if (item.get("crafted")) { + if (item.get("crafted")) { crafted.push(item); } + else if (item.get("reqs").every(x => x === 0)) { + fixed.push(item); + } // TODO hack: We will treat ALL set items as unsafe :( else if (item.get("skillpoints").every(x => x === 0) && item.get("set") === null) { noboost.push(item); @@ -191,6 +191,6 @@ function calculate_skillpoints(equipment, weapon) { apply_skillpoints(final_skillpoints, weapon, best_activeSetCounts); best_total += total_diff; } - let equip_order = fixed.concat(best); + let equip_order = fixed.concat(best).concat(crafted); return [equip_order, best_skillpoints, final_skillpoints, best_total, best_activeSetCounts]; }