diff --git a/src/Corporation/Actions.ts b/src/Corporation/Actions.ts index 591892659..ab331a7b3 100644 --- a/src/Corporation/Actions.ts +++ b/src/Corporation/Actions.ts @@ -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; diff --git a/src/Corporation/ui/modals/PurchaseMaterialModal.tsx b/src/Corporation/ui/modals/PurchaseMaterialModal.tsx index d0f674ff5..2cd9dd1ea 100644 --- a/src/Corporation/ui/modals/PurchaseMaterialModal.tsx +++ b/src/Corporation/ui/modals/PurchaseMaterialModal.tsx @@ -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 ( <>