use minimum of given and maximum threads

This commit is contained in:
chris380
2022-04-13 09:19:09 +02:00
parent 4c113c19eb
commit 355d2bd8f9

View File

@@ -633,7 +633,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
if (percentHacked > 0) {
// thread count is limited to the maximum number of threads needed
threads = Math.ceil(1 / percentHacked);
threads = Math.min(threads, Math.ceil(1 / percentHacked));
}
}