mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
API: Fix serverExists()
return true for not revealed servers (#1013)
This commit is contained in:
parent
f0f335e09a
commit
7017f3c2f8
@ -1116,7 +1116,8 @@ export const ns: InternalAPI<NSFull> = {
|
||||
},
|
||||
serverExists: (ctx) => (_hostname) => {
|
||||
const hostname = helpers.string(ctx, "hostname", _hostname);
|
||||
return GetServer(hostname) !== null;
|
||||
const server = GetServer(hostname);
|
||||
return server !== null && (server.serversOnNetwork.length > 0 || server.hostname === "home");
|
||||
},
|
||||
fileExists: (ctx) => (_filename, _hostname) => {
|
||||
const filename = helpers.string(ctx, "filename", _filename);
|
||||
|
Loading…
Reference in New Issue
Block a user