mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +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;
|
sCost = optimalPrice;
|
||||||
} else if (mat.marketTa1) {
|
} else if (mat.marketTa1) {
|
||||||
sCost = mat.marketPrice + markupLimit;
|
sCost = mat.marketPrice + markupLimit;
|
||||||
// check truthyness to avoid unnecessary eval
|
} else if (typeof mat.desiredSellPrice === "string") {
|
||||||
} else if (typeof mat.desiredSellPrice === "string" && mat.desiredSellPrice) {
|
|
||||||
sCost = mat.desiredSellPrice.replace(/MP/g, mat.marketPrice.toString());
|
sCost = mat.desiredSellPrice.replace(/MP/g, mat.marketPrice.toString());
|
||||||
sCost = eval(sCost);
|
sCost = eval(sCost);
|
||||||
} else {
|
} else {
|
||||||
@ -903,7 +902,7 @@ export class Division {
|
|||||||
product.markup = 1;
|
product.markup = 1;
|
||||||
}
|
}
|
||||||
sCostString = sCostString.replace(/MP/g, product.cityData[city].productionCost.toString());
|
sCostString = sCostString.replace(/MP/g, product.cityData[city].productionCost.toString());
|
||||||
sCost = Math.max(product.cityData[city].productionCost, eval(sCostString));
|
sCost = eval(sCostString);
|
||||||
} else {
|
} else {
|
||||||
sCost = sellPrice;
|
sCost = sellPrice;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user