Fixed connect.js

This commit is contained in:
Zakary Timson 2022-03-12 15:08:07 +00:00
parent 8f1ac22fa1
commit bb2d98481f

View File

@ -32,7 +32,7 @@ export function main(ns) {
const newDevices = ns.scan(current).filter(d => !blacklist.has(d)); const newDevices = ns.scan(current).filter(d => !blacklist.has(d));
if(newDevices.length == 0) return []; if(newDevices.length == 0) return [];
if(newDevices.find(d => d == device)) return [...path, device]; if(newDevices.find(d => d == device)) return [...path, device];
return newDevices.map(d => find(device, d, [...path, d], all)).find(p => p && p.length); return newDevices.map(d => find(device, d, [...path, d], blacklist)).find(p => p && p.length);
} }
// Run // Run