CODEBASE: Add comments explaining redundant check in product calculation (#2705)

This commit is contained in:
catloversg
2026-05-01 06:18:22 +07:00
committed by GitHub
parent eeef4cf772
commit a99eeea80c
+1 -1
View File
@@ -873,12 +873,12 @@ export class Division {
}
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
let netStorageSize = product.size;
for (const [reqMatName, reqQty] of getRecordEntries(product.requiredMaterials)) {
netStorageSize -= MaterialInfo[reqMatName].size * reqQty;
}
//If there's not enough space in warehouse, limit the amount of Product
if (netStorageSize > 0) {
const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);