mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-25 17:13:47 +01:00
CORPORATION: Fix wrong product price calculation (#1451)
This commit is contained in:
parent
960fe5aa8b
commit
3c29757827
@ -574,8 +574,7 @@ export class Division {
|
||||
sCost = optimalPrice;
|
||||
} else if (mat.marketTa1) {
|
||||
sCost = mat.marketPrice + markupLimit;
|
||||
// check truthyness to avoid unnecessary eval
|
||||
} else if (typeof mat.desiredSellPrice === "string" && mat.desiredSellPrice) {
|
||||
} else if (typeof mat.desiredSellPrice === "string") {
|
||||
sCost = mat.desiredSellPrice.replace(/MP/g, mat.marketPrice.toString());
|
||||
sCost = eval(sCost);
|
||||
} else {
|
||||
@ -903,7 +902,7 @@ export class Division {
|
||||
product.markup = 1;
|
||||
}
|
||||
sCostString = sCostString.replace(/MP/g, product.cityData[city].productionCost.toString());
|
||||
sCost = Math.max(product.cityData[city].productionCost, eval(sCostString));
|
||||
sCost = eval(sCostString);
|
||||
} else {
|
||||
sCost = sellPrice;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user