diff --git a/skillpoint_test.py b/skillpoint_test.py
index 5e8e681..0738100 100644
--- a/skillpoint_test.py
+++ b/skillpoint_test.py
@@ -92,6 +92,8 @@ def apply_to_fit(skillpoints, item):
applied = [0, 0, 0, 0, 0]
total = 0
for i, req, cur in zip(range(5), item["reqs"], skillpoints):
+ if (item["reqs"][i] == 0):
+ continue
if req > cur:
diff = req - cur
applied[i] += diff
diff --git a/skillpoints.js b/skillpoints.js
index 3c78f42..248735d 100644
--- a/skillpoints.js
+++ b/skillpoints.js
@@ -34,6 +34,7 @@ function calculate_skillpoints(equipment, weapon) {
let applied = [0, 0, 0, 0, 0];
let total = 0;
for (let i = 0; i < 5; i++) {
+ if (item.reqs[i] == 0) continue;
const req = item.reqs[i];
const cur = skillpoints[i];
if (req > cur) {
@@ -87,8 +88,14 @@ function calculate_skillpoints(equipment, weapon) {
}
}
if (total_applied < best_total) {
+ console.log(total_applied);
+ console.log(skillpoints_applied);
+ console.log("Iteration 2");
for (const item of permutation) {
+ console.log(item);
+
remove_skillpoints(skillpoints, item);
+ console.log(skillpoints);
result = apply_to_fit(skillpoints, item);
needed_skillpoints = result[0];
total_diff = result[1];
@@ -96,7 +103,10 @@ function calculate_skillpoints(equipment, weapon) {
skillpoints_applied[i] += needed_skillpoints[i];
skillpoints[i] += needed_skillpoints[i];
}
+
apply_skillpoints(skillpoints, item);
+ console.log(skillpoints);
+ console.log(total_diff);
total_applied += total_diff;
if (total_applied >= best_total) {
break;
diff --git a/test.js b/test.js
index fd8cb5d..9c96207 100644
--- a/test.js
+++ b/test.js
@@ -190,6 +190,8 @@ function calculateBuild(){
console.log(skillpoints);
player_build.assigned_skillpoints;
+ setHTML("summary-box", "Summary: Assigned " + player_build.assigned_skillpoints + " skillpoints.");
+
setHTML("build-helmet", player_build.helmet.name);
setHTML("build-chestplate", player_build.chestplate.name);
setHTML("build-leggings", player_build.helmet.name);