Implemented infinite loop safety net.

This commit is contained in:
Olivier Gagnon
2022-05-07 17:43:45 -04:00
parent b46718d188
commit fb08139903
6 changed files with 30 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ export function netscriptDelay(time: number, workerScript: WorkerScript): Promis
workerScript.delay = null;
workerScript.delayReject = undefined;
workerScript.infiniteLoopSafetyCounter = 0;
if (workerScript.env.stopFlag) reject(new ScriptDeath(workerScript));
else resolve();
}, time);