|
|
|
@@ -285,7 +285,7 @@ function upgradeReachable(id) { |
|
|
|
for (let upgrade of reqs) { |
|
|
|
if (!ownedUpgrades[upgrade]) { |
|
|
|
return false; |
|
|
|
}currentProductivity["food"] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -310,8 +310,10 @@ function upgradeAvailable(id) { |
|
|
|
} |
|
|
|
} else if (type == "productivity") { |
|
|
|
console.log(type, reqs); |
|
|
|
if (currentProductivity < reqs) { |
|
|
|
return false; |
|
|
|
for (const [key, value] of Object.entries(reqs)) { |
|
|
|
if (currentProductivity[key] < value) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -418,7 +420,7 @@ function renderPrereqs(prereqs) { |
|
|
|
for (const [id, amount] of Object.entries(prereqs.productivity)) { |
|
|
|
list.push({ |
|
|
|
"text": amount + " " + resourceTypes[id].name + "/s", |
|
|
|
"valid": currentProductivity[id].count >= amount |
|
|
|
"valid": currentProductivity[id] >= amount |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|