mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
MISC: add stopFlag check before running main (#1689)
It's possible that before the script starts runn, the stopFlag is set.
This commit is contained in:
@@ -56,6 +56,9 @@ async function startNetscript2Script(workerScript: WorkerScript): Promise<void>
|
||||
|
||||
const loadedModule = await compile(script, scripts);
|
||||
|
||||
// if for whatever reason the stopFlag is already set we abort
|
||||
if (workerScript.env.stopFlag) return;
|
||||
|
||||
if (!loadedModule) throw `${script.filename} cannot be run because the script module won't load`;
|
||||
const mainFunc = loadedModule.main;
|
||||
// TODO unplanned: Better error for "unexpected reserved word" when using await in non-async function?
|
||||
|
||||
Reference in New Issue
Block a user