mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
BUGFIX: Cannot buy augmentations via UI when money is equal to cost (#2039)
This commit is contained in:
@@ -240,7 +240,7 @@ export function PurchasableAugmentation(props: IPurchasableAugProps): React.Reac
|
|||||||
{props.owned || (
|
{props.owned || (
|
||||||
<Box sx={{ display: "grid", alignItems: "center", gridTemplateColumns: "1fr 1fr" }}>
|
<Box sx={{ display: "grid", alignItems: "center", gridTemplateColumns: "1fr 1fr" }}>
|
||||||
<Requirement
|
<Requirement
|
||||||
fulfilled={cost === 0 || Player.money > cost}
|
fulfilled={cost === 0 || Player.money >= cost}
|
||||||
value={formatMoney(cost)}
|
value={formatMoney(cost)}
|
||||||
color={Settings.theme.money}
|
color={Settings.theme.money}
|
||||||
incompleteColor={Settings.theme.error}
|
incompleteColor={Settings.theme.error}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export function AugmentationsPage({ faction }: { faction: Faction }): React.Reac
|
|||||||
const repCost = augCosts.repCost;
|
const repCost = augCosts.repCost;
|
||||||
const hasReq = faction.playerReputation >= repCost;
|
const hasReq = faction.playerReputation >= repCost;
|
||||||
const hasRep = hasAugmentationPrereqs(aug);
|
const hasRep = hasAugmentationPrereqs(aug);
|
||||||
const hasCost = augCosts.moneyCost !== 0 && Player.money > augCosts.moneyCost;
|
const hasCost = augCosts.moneyCost !== 0 && Player.money >= augCosts.moneyCost;
|
||||||
return hasCost && hasReq && hasRep;
|
return hasCost && hasReq && hasRep;
|
||||||
}
|
}
|
||||||
const buy = augs.filter(canBuy).sort((augName1, augName2) => {
|
const buy = augs.filter(canBuy).sort((augName1, augName2) => {
|
||||||
@@ -243,7 +243,7 @@ export function AugmentationsPage({ faction }: { faction: Faction }): React.Reac
|
|||||||
return (
|
return (
|
||||||
hasAugmentationPrereqs(aug) &&
|
hasAugmentationPrereqs(aug) &&
|
||||||
faction.playerReputation >= costs.repCost &&
|
faction.playerReputation >= costs.repCost &&
|
||||||
(costs.moneyCost === 0 || Player.money > costs.moneyCost)
|
(costs.moneyCost === 0 || Player.money >= costs.moneyCost)
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
purchaseAugmentation={(aug, showModal) => {
|
purchaseAugmentation={(aug, showModal) => {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
|
|||||||
augNames={availableAugs.map((aug) => aug.name)}
|
augNames={availableAugs.map((aug) => aug.name)}
|
||||||
ownedAugNames={ownedAugNames}
|
ownedAugNames={ownedAugNames}
|
||||||
canPurchase={(aug) => {
|
canPurchase={(aug) => {
|
||||||
return Player.money > aug.baseCost;
|
return Player.money >= aug.baseCost;
|
||||||
}}
|
}}
|
||||||
purchaseAugmentation={(aug) => {
|
purchaseAugmentation={(aug) => {
|
||||||
props.sleeve.tryBuyAugmentation(aug);
|
props.sleeve.tryBuyAugmentation(aug);
|
||||||
|
|||||||
Reference in New Issue
Block a user