mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 11:10:58 +02:00
fix the amt issue for modal also
This commit is contained in:
@@ -260,7 +260,7 @@ export function BulkPurchase(corp: ICorporation, warehouse: Warehouse, material:
|
|||||||
if (isNaN(amt) || amt < 0) {
|
if (isNaN(amt) || amt < 0) {
|
||||||
throw new Error(`Invalid input amount`);
|
throw new Error(`Invalid input amount`);
|
||||||
}
|
}
|
||||||
if (amt >= maxAmount) {
|
if (amt > maxAmount) {
|
||||||
throw new Error(`You do not have enough warehouse size to fit this purchase`);
|
throw new Error(`You do not have enough warehouse size to fit this purchase`);
|
||||||
}
|
}
|
||||||
const cost = amt * material.bCost;
|
const cost = amt * material.bCost;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ function BulkPurchaseSection(props: IBPProps): React.ReactElement {
|
|||||||
const matSize = MaterialSizes[props.mat.name];
|
const matSize = MaterialSizes[props.mat.name];
|
||||||
const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;
|
const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;
|
||||||
|
|
||||||
if (parsedAmt * matSize > maxAmount) {
|
if (parsedAmt > maxAmount) {
|
||||||
setDisabled(true);
|
setDisabled(true);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user