Fix number sort
This commit is contained in:
parent
ab6635d00e
commit
fad1c1a7c4
@ -39,8 +39,8 @@ export function recursiveHackingRequired(ns: NS) {
|
||||
for (let server of servers) {
|
||||
levels.push(ns.getServerRequiredHackingLevel(server))
|
||||
}
|
||||
// remove duplicates
|
||||
return [...new Set(levels)].sort()
|
||||
// Sort and remove duplicates, need custom sort because built-in sort only works alphabetically 💀
|
||||
return [...new Set(levels)].sort((a, b) => a - b)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user