fixed getServer instead

This commit is contained in:
Olivier Gagnon 2018-06-13 12:34:32 -04:00
parent 07c9f9e155
commit bb68fa5806
2 changed files with 4 additions and 2 deletions

@ -1199,7 +1199,7 @@ function NetscriptFunctions(workerScript) {
return updateStaticRam("serverExists", CONSTANTS.ScriptGetServerRamCost); return updateStaticRam("serverExists", CONSTANTS.ScriptGetServerRamCost);
} }
updateDynamicRam("serverExists", CONSTANTS.ScriptGetServerRamCost); updateDynamicRam("serverExists", CONSTANTS.ScriptGetServerRamCost);
return (getServer(ip) != null); return (getServer(ip) !== null);
}, },
fileExists : function(filename,ip=workerScript.serverIp) { fileExists : function(filename,ip=workerScript.serverIp) {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {

@ -873,9 +873,11 @@ function GetServerByHostname(hostname) {
function getServer(s) { function getServer(s) {
if (!isValidIPAddress(s)) { if (!isValidIPAddress(s)) {
return GetServerByHostname(s); return GetServerByHostname(s);
} else { }
if(AllServers[s] !== undefined) {
return AllServers[s]; return AllServers[s];
} }
return null;
} }
//Debugging tool //Debugging tool