Fix a bug where a JS script would never exit if killed in a sleep loop.

This commit is contained in:
James Aguilar 2018-05-06 22:07:14 -04:00
parent 9372236a6e
commit 7045f5d74e

@ -229,6 +229,7 @@ function NetscriptFunctions(workerScript) {
workerScript.scriptRef.log("Sleeping for " + time + " milliseconds");
}
return netscriptDelay(time, workerScript).then(function() {
if (workerScript.env.stopFlag) {return Promise.reject(workerScript);}
return Promise.resolve(true);
});
},