mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
fix getNodeStats error
This commit is contained in:
@@ -375,7 +375,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
};
|
||||
|
||||
// Utility function to get Hacknet Node object
|
||||
const getHacknetNode = function (i: any, callingFn: any = ""): HacknetNode | HacknetServer {
|
||||
const getHacknetNode = function (i: any, callingFn: string = ""): HacknetNode | HacknetServer {
|
||||
if (isNaN(i)) {
|
||||
throw makeRuntimeErrorMsg(callingFn, "Invalid index specified for Hacknet Node: " + i);
|
||||
}
|
||||
@@ -385,7 +385,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
|
||||
if (hasHacknetServers(Player)) {
|
||||
const hi = Player.hacknetNodes[i];
|
||||
if (typeof hi !== "number") throw new Error("hacknet node was not number");
|
||||
if (typeof hi !== "string") throw new Error("hacknet node was not a string");
|
||||
const hserver = AllServers[hi];
|
||||
if (!(hserver instanceof HacknetServer)) throw new Error("hacknet server was not actually hacknet server");
|
||||
if (hserver == null) {
|
||||
|
||||
Reference in New Issue
Block a user