mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Refactor netscriptDelay and script kill interaction
Store the Promise reject function instead of resolve in WorkerScript, since it's only used when killing a script that's blocked in delay. And when killing a script, reject the delay Promise with the WorkerScript as cause.
This commit is contained in:
@@ -138,8 +138,8 @@ function killNetscriptDelay(workerScript: WorkerScript): void {
|
||||
if (workerScript instanceof WorkerScript) {
|
||||
if (workerScript.delay) {
|
||||
clearTimeout(workerScript.delay);
|
||||
if (workerScript.delayResolve) {
|
||||
workerScript.delayResolve();
|
||||
if (workerScript.delayReject) {
|
||||
workerScript.delayReject(workerScript);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user