mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-20 22:52:07 +02:00
CODEBASE: Add comments explaining redundant check in product calculation (#2705)
This commit is contained in:
@@ -873,12 +873,12 @@ export class Division {
|
|||||||
}
|
}
|
||||||
prod *= corpConstants.secondsPerMarketCycle * marketCycles;
|
prod *= corpConstants.secondsPerMarketCycle * marketCycles;
|
||||||
|
|
||||||
|
// The "netStorageSize" check is redundant, but retained in case the product size calculation changes.
|
||||||
//Calculate net change in warehouse storage making the Products will cost
|
//Calculate net change in warehouse storage making the Products will cost
|
||||||
let netStorageSize = product.size;
|
let netStorageSize = product.size;
|
||||||
for (const [reqMatName, reqQty] of getRecordEntries(product.requiredMaterials)) {
|
for (const [reqMatName, reqQty] of getRecordEntries(product.requiredMaterials)) {
|
||||||
netStorageSize -= MaterialInfo[reqMatName].size * reqQty;
|
netStorageSize -= MaterialInfo[reqMatName].size * reqQty;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If there's not enough space in warehouse, limit the amount of Product
|
//If there's not enough space in warehouse, limit the amount of Product
|
||||||
if (netStorageSize > 0) {
|
if (netStorageSize > 0) {
|
||||||
const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);
|
const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user