BUGFIX: Check that the augmentation is available before installing it on a sleeve. (#1320)

This commit is contained in:
Yichi Zhang 2024-05-27 15:34:19 -07:00 committed by GitHub
parent 53f187fb89
commit e674a177d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -274,6 +274,9 @@ export class Sleeve extends Person implements SleevePerson {
// Verify that this sleeve does not already have that augmentation.
if (this.hasAugmentation(aug.name)) return false;
// Verify that the augmentation is available for purchase.
if (!this.findPurchasableAugs().includes(aug)) return false;
Player.loseMoney(aug.baseCost, "sleeves");
this.installAugmentation(aug);
return true;