Merge pull request #3176 from incubusnb/Sleeve

Fixed: purchaseSleeveAug checks shock value
This commit is contained in:
hydroflame 2022-03-18 23:43:43 -04:00 committed by GitHub
commit 77cb7dd775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -289,6 +289,10 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
checkSleeveAPIAccess("purchaseSleeveAug"); checkSleeveAPIAccess("purchaseSleeveAug");
checkSleeveNumber("purchaseSleeveAug", sleeveNumber); checkSleeveNumber("purchaseSleeveAug", sleeveNumber);
if (player.sleeves[sleeveNumber].shock > 0){
throw helper.makeRuntimeErrorMsg("sleeve.purchaseSleeveAug", `Sleeve shock too high: Sleeve ${sleeveNumber}`);
}
const aug = Augmentations[augName]; const aug = Augmentations[augName];
if (!aug) { if (!aug) {
throw helper.makeRuntimeErrorMsg("sleeve.purchaseSleeveAug", `Invalid aug: ${augName}`); throw helper.makeRuntimeErrorMsg("sleeve.purchaseSleeveAug", `Invalid aug: ${augName}`);