mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-28 10:33:47 +01:00
fix netscript port read not correctly converting ns1 objects
This commit is contained in:
parent
a420a87eba
commit
75a2742911
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2396,7 +2396,9 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
if (iport == null || !(iport instanceof Object)) {
|
if (iport == null || !(iport instanceof Object)) {
|
||||||
throw makeRuntimeErrorMsg("read", `Could not find port: ${port}. This is a bug. Report to dev.`);
|
throw makeRuntimeErrorMsg("read", `Could not find port: ${port}. This is a bug. Report to dev.`);
|
||||||
}
|
}
|
||||||
return iport.read();
|
const x = iport.read();
|
||||||
|
console.log(x);
|
||||||
|
return x;
|
||||||
} else if (isString(port)) {
|
} else if (isString(port)) {
|
||||||
// Read from script or text file
|
// Read from script or text file
|
||||||
const fn = port;
|
const fn = port;
|
||||||
@ -2443,7 +2445,9 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
if (iport == null || !(iport instanceof Object)) {
|
if (iport == null || !(iport instanceof Object)) {
|
||||||
throw makeRuntimeErrorMsg("peek", `Could not find port: ${port}. This is a bug. Report to dev.`);
|
throw makeRuntimeErrorMsg("peek", `Could not find port: ${port}. This is a bug. Report to dev.`);
|
||||||
}
|
}
|
||||||
return iport.peek();
|
const x = iport.peek();
|
||||||
|
console.log(x);
|
||||||
|
return x;
|
||||||
},
|
},
|
||||||
clear: function (port: any): any {
|
clear: function (port: any): any {
|
||||||
updateDynamicRam("clear", getRamCost("clear"));
|
updateDynamicRam("clear", getRamCost("clear"));
|
||||||
|
@ -198,7 +198,6 @@ function startNetscript1Script(workerScript: WorkerScript): Promise<WorkerScript
|
|||||||
name === "vsprintf" ||
|
name === "vsprintf" ||
|
||||||
name === "scp" ||
|
name === "scp" ||
|
||||||
name == "write" ||
|
name == "write" ||
|
||||||
name === "read" ||
|
|
||||||
name === "tryWrite" ||
|
name === "tryWrite" ||
|
||||||
name === "run" ||
|
name === "run" ||
|
||||||
name === "exec"
|
name === "exec"
|
||||||
|
Loading…
Reference in New Issue
Block a user