Fix logic bug

This commit is contained in:
Isaac Shoebottom 2023-11-03 21:38:00 -03:00
parent 74aae19a82
commit 29d88170ab

View File

@ -97,11 +97,11 @@ export function performFunctionIfCapable(ns: NS, server: string, func: CallableF
} }
if (ns.getServerNumPortsRequired(server) < ns.getServer(server).openPortCount) { if (ns.getServerNumPortsRequired(server) < ns.getServer(server).openPortCount) {
ns.print(`Not enough ports, trying to root ${server}`) ns.print(`Not enough ports, trying to root ${server}`)
}
if (rootServer(ns, server) < ns.getServerNumPortsRequired(server)) { if (rootServer(ns, server) < ns.getServerNumPortsRequired(server)) {
ns.print(`Need more port opening programs to root ${server}`) ns.print(`Need more port opening programs to root ${server}`)
return false return false
} }
}
if (!ns.hasRootAccess(server)) { if (!ns.hasRootAccess(server)) {
ns.print(`Failed to root ${server}`) ns.print(`Failed to root ${server}`)
return false return false