fix netscript access

This commit is contained in:
Olivier Gagnon 2021-04-29 13:39:03 -04:00
parent 15bd8a6233
commit 50b490ba8d

@ -521,7 +521,7 @@ function NetscriptFunctions(workerScript) {
} }
const checkFormulasAccess = function(func, n) { 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 = ''; let extra = '';
if (n !== 5) { if (n !== 5) {
extra = ` and Source-File ${n}-1`; extra = ` and Source-File ${n}-1`;
@ -1638,7 +1638,7 @@ function NetscriptFunctions(workerScript) {
}, },
getServer: function(ip) { getServer: function(ip) {
updateDynamicRam("getServer", getRamCost("getServer")); updateDynamicRam("getServer", getRamCost("getServer"));
if (SourceFileFlags[5] <= 0) { if (SourceFileFlags[5] <= 0 && Player.bitNodeN !== 5) {
throw makeRuntimeErrorMsg("getServer", "Requires Source-File 5 to run."); throw makeRuntimeErrorMsg("getServer", "Requires Source-File 5 to run.");
} }
const server = safeGetServer(ip, "getServer"); const server = safeGetServer(ip, "getServer");