mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Minor bugfixes for a variety of NS functions. After infiltration, UI returns to corp page rather than city page
This commit is contained in:
@@ -405,7 +405,7 @@ function NetscriptFunctions(workerScript) {
|
||||
const node = getHacknetNode(i);
|
||||
const hasUpgraded = hasHacknetServers();
|
||||
const res = {
|
||||
name: node.name,
|
||||
name: hasUpgraded ? node.hostname : node.name,
|
||||
level: node.level,
|
||||
ram: hasUpgraded ? node.maxRam : node.ram,
|
||||
cores: node.cores,
|
||||
@@ -416,6 +416,7 @@ function NetscriptFunctions(workerScript) {
|
||||
|
||||
if (hasUpgraded) {
|
||||
res.cache = node.cache;
|
||||
res.hashCapacity = node.hashCapacity;
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -1993,6 +1994,13 @@ function NetscriptFunctions(workerScript) {
|
||||
throw makeRuntimeRejectMsg(workerScript, `write() failed due to invalid filepath: ${fn}`);
|
||||
}
|
||||
|
||||
// Coerce 'data' to be a string
|
||||
try {
|
||||
data = String(data);
|
||||
} catch (e) {
|
||||
throw makeRuntimeRejectMsg(workerScript, `write() failed because of invalid data (${e}). Data being written must be convertible to a string`);
|
||||
}
|
||||
|
||||
const server = workerScript.getServer();
|
||||
if (server == null) {
|
||||
throw makeRuntimeRejectMsg(workerScript, "Error getting Server for this script in write(). This is a bug please contact game dev");
|
||||
|
||||
Reference in New Issue
Block a user