From 50b490ba8da3740e5a72d61d761d7158f4135e82 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 29 Apr 2021 13:39:03 -0400 Subject: [PATCH] fix netscript access --- src/NetscriptFunctions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 27b5ad702..4a3d81986 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -521,7 +521,7 @@ function NetscriptFunctions(workerScript) { } const checkFormulasAccess = function(func, n) { - if (SourceFileFlags[5] < 1 || SourceFileFlags[n] < 1) { + if ((SourceFileFlags[5] < 1 && Player.bitNodeN !== 5) || (SourceFileFlags[n] < 1 && Player.bitNodeN !== n)) { let extra = ''; if (n !== 5) { extra = ` and Source-File ${n}-1`; @@ -1638,7 +1638,7 @@ function NetscriptFunctions(workerScript) { }, getServer: function(ip) { updateDynamicRam("getServer", getRamCost("getServer")); - if (SourceFileFlags[5] <= 0) { + if (SourceFileFlags[5] <= 0 && Player.bitNodeN !== 5) { throw makeRuntimeErrorMsg("getServer", "Requires Source-File 5 to run."); } const server = safeGetServer(ip, "getServer");