Fix case where you jump too many levels at once
This commit is contained in:
parent
f0d4017711
commit
c320b31ac3
@ -7,7 +7,7 @@ export async function main(ns: NS) {
|
|||||||
levels = levels.filter(level => level > hackingLevel)
|
levels = levels.filter(level => level > hackingLevel)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (levels.includes(hackingLevel)) {
|
if (Math.min(...levels) <= hackingLevel) {
|
||||||
// remove the level from the list, so we don't try to hack it again
|
// remove the level from the list, so we don't try to hack it again
|
||||||
levels.splice(levels.indexOf(hackingLevel), 1)
|
levels.splice(levels.indexOf(hackingLevel), 1)
|
||||||
ns.tprint(`Hacking level increased to ${hackingLevel}`)
|
ns.tprint(`Hacking level increased to ${hackingLevel}`)
|
||||||
|
Loading…
Reference in New Issue
Block a user