mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 10:13:52 +01:00
fix the amt issue for modal also
This commit is contained in:
parent
a8689cb28b
commit
10fafd39f3
@ -260,7 +260,7 @@ export function BulkPurchase(corp: ICorporation, warehouse: Warehouse, material:
|
||||
if (isNaN(amt) || amt < 0) {
|
||||
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`);
|
||||
}
|
||||
const cost = amt * material.bCost;
|
||||
|
@ -36,7 +36,7 @@ function BulkPurchaseSection(props: IBPProps): React.ReactElement {
|
||||
const matSize = MaterialSizes[props.mat.name];
|
||||
const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;
|
||||
|
||||
if (parsedAmt * matSize > maxAmount) {
|
||||
if (parsedAmt > maxAmount) {
|
||||
setDisabled(true);
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user