From b437adb16ceac75016363d832cd6429a8f08112e Mon Sep 17 00:00:00 2001 From: nickofolas Date: Wed, 23 Mar 2022 15:48:39 -0500 Subject: [PATCH] Simplify API check --- src/NetscriptFunctions/Grafting.ts | 2 +- src/SourceFile/SourceFiles.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetscriptFunctions/Grafting.ts b/src/NetscriptFunctions/Grafting.ts index 124ab0206..8101b3f1c 100644 --- a/src/NetscriptFunctions/Grafting.ts +++ b/src/NetscriptFunctions/Grafting.ts @@ -12,7 +12,7 @@ import { INetscriptHelper } from "./INetscriptHelper"; export function NetscriptGrafting(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IGrafting { const checkGraftingAPIAccess = (func: any): void => { - if (player.bitNodeN !== 10 && !SourceFileFlags[10]) { + if (!player.canAccessGrafting()) { throw helper.makeRuntimeErrorMsg( `grafting.${func}`, "You do not currently have access to the Grafting API. This is either because you are not in BitNode 10 or because you do not have Source-File 10", diff --git a/src/SourceFile/SourceFiles.tsx b/src/SourceFile/SourceFiles.tsx index 20cc9f452..a8bd75811 100644 --- a/src/SourceFile/SourceFiles.tsx +++ b/src/SourceFile/SourceFiles.tsx @@ -167,8 +167,8 @@ SourceFiles["SourceFile10"] = new SourceFile( 10, ( <> - This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a - Duplicate Sleeve + This Source-File unlocks Sleeve technology, and the Grafting API in other BitNodes. + Each level of this Source-File also grants you a Duplicate Sleeve ), );