mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 20:55:44 +01:00
CORP: Products sell all at price of 0 (#1330)
Match material behaviour - price of 0 discards stored products
This commit is contained in:
parent
a28bb4bd99
commit
1f08724fea
@ -925,6 +925,8 @@ export class Division {
|
|||||||
if (sCost - product.cityData[city].productionCost > markupLimit) {
|
if (sCost - product.cityData[city].productionCost > markupLimit) {
|
||||||
markup = markupLimit / (sCost - product.cityData[city].productionCost);
|
markup = markupLimit / (sCost - product.cityData[city].productionCost);
|
||||||
}
|
}
|
||||||
|
} else if (sCost <= 0) {
|
||||||
|
markup = 1e12; //Sell everything, essentially discard - as materials
|
||||||
}
|
}
|
||||||
|
|
||||||
product.maxSellAmount =
|
product.maxSellAmount =
|
||||||
@ -939,7 +941,7 @@ export class Division {
|
|||||||
sellAmt = Math.min(product.maxSellAmount, sellAmt);
|
sellAmt = Math.min(product.maxSellAmount, sellAmt);
|
||||||
sellAmt = sellAmt * corpConstants.secondsPerMarketCycle * marketCycles;
|
sellAmt = sellAmt * corpConstants.secondsPerMarketCycle * marketCycles;
|
||||||
sellAmt = Math.min(product.cityData[city].stored, sellAmt); //data[0] is qty
|
sellAmt = Math.min(product.cityData[city].stored, sellAmt); //data[0] is qty
|
||||||
if (sellAmt && sCost) {
|
if (sellAmt && sCost >= 0) {
|
||||||
product.cityData[city].stored -= sellAmt; //data[0] is qty
|
product.cityData[city].stored -= sellAmt; //data[0] is qty
|
||||||
totalProfit += sellAmt * sCost;
|
totalProfit += sellAmt * sCost;
|
||||||
product.cityData[city].actualSellAmount = sellAmt / (corpConstants.secondsPerMarketCycle * marketCycles); //data[2] is sell property
|
product.cityData[city].actualSellAmount = sellAmt / (corpConstants.secondsPerMarketCycle * marketCycles); //data[2] is sell property
|
||||||
|
Loading…
Reference in New Issue
Block a user