libram 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/diet/index.js +8 -2
- package/package.json +1 -1
package/dist/diet/index.js
CHANGED
|
@@ -197,8 +197,14 @@ class DietPlanner {
|
|
|
197
197
|
spleenItems.sort((x, y) => -(this.consumptionValue(x) / x.item.spleen -
|
|
198
198
|
this.consumptionValue(y) / y.item.spleen));
|
|
199
199
|
if (spleenItems.length > 0) {
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
// Marginal value for sliders and jars depends on our best unlimited spleen item.
|
|
201
|
+
// TODO: spleenLimit() - mySpleenUse() is a poor estimate.
|
|
202
|
+
const bestMarginalSpleenItem = spleenItems.find((spleenItem) => spleenItem.maximum === undefined ||
|
|
203
|
+
spleenItem.maximum * spleenItem.size >= spleenLimit() - mySpleenUse());
|
|
204
|
+
if (bestMarginalSpleenItem) {
|
|
205
|
+
this.spleenValue = Math.max(0, this.consumptionValue(bestMarginalSpleenItem) /
|
|
206
|
+
bestMarginalSpleenItem.size);
|
|
207
|
+
}
|
|
202
208
|
}
|
|
203
209
|
}
|
|
204
210
|
/**
|