From 395b583905876b35d14adb84136ecaf50d1e01db Mon Sep 17 00:00:00 2001 From: Staszek Welsh Date: Mon, 4 Jul 2022 23:44:58 +0100 Subject: [PATCH] Add faction membership check to singularity.purchaseAugmentation --- src/NetscriptFunctions/Singularity.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 55ebdba68..7f0fa8b77 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -164,6 +164,11 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript const augs = getFactionAugmentationsFiltered(player, fac); + if (!player.factions.includes(fac.name)) { + _ctx.log(() => `You can't purchase augmentations from '${facName}' because you aren't a member`); + return false; + } + if (!augs.includes(augName)) { _ctx.log(() => `Faction '${facName}' does not have the '${augName}' augmentation.`); return false;