From 355d2bd8f94862791e9797ab17df398695fdd941 Mon Sep 17 00:00:00 2001 From: chris380 Date: Wed, 13 Apr 2022 09:19:09 +0200 Subject: [PATCH] use minimum of given and maximum threads --- src/NetscriptFunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 8c06637b0..5cf6a4309 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -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)); } }