mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 21:52:30 +01:00
exitExits
This commit is contained in:
parent
2592c6ccd8
commit
1be015898c
@ -79,6 +79,7 @@ import { CalculateShareMult, StartSharing } from "./NetworkShare/Share";
|
|||||||
import { recentScripts } from "./Netscript/RecentScripts";
|
import { recentScripts } from "./Netscript/RecentScripts";
|
||||||
import { InternalAPI, NetscriptContext, wrapAPI } from "./Netscript/APIWrapper";
|
import { InternalAPI, NetscriptContext, wrapAPI } from "./Netscript/APIWrapper";
|
||||||
import { INetscriptExtra } from "./NetscriptFunctions/Extra";
|
import { INetscriptExtra } from "./NetscriptFunctions/Extra";
|
||||||
|
import { ScriptDeath } from "./Netscript/ScriptDeath";
|
||||||
|
|
||||||
export type NSFull = NS & INetscriptExtra;
|
export type NSFull = NS & INetscriptExtra;
|
||||||
|
|
||||||
@ -833,12 +834,10 @@ const base: InternalAPI<NS> = {
|
|||||||
|
|
||||||
return scriptsKilled > 0;
|
return scriptsKilled > 0;
|
||||||
},
|
},
|
||||||
exit: (ctx: NetscriptContext) => (): void => {
|
exit: (ctx: NetscriptContext) => (): never => {
|
||||||
if (killWorkerScript(ctx.workerScript)) {
|
helpers.log(ctx, () => "Exiting...");
|
||||||
helpers.log(ctx, () => "Exiting...");
|
ctx.workerScript.env.stopFlag = true;
|
||||||
} else {
|
throw new ScriptDeath(ctx.workerScript);
|
||||||
helpers.log(ctx, () => "Failed. This is a bug. Report to dev.");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
scp:
|
scp:
|
||||||
(ctx: NetscriptContext) =>
|
(ctx: NetscriptContext) =>
|
||||||
|
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -5424,7 +5424,7 @@ export interface NS {
|
|||||||
* @remarks
|
* @remarks
|
||||||
* RAM cost: 0 GB
|
* RAM cost: 0 GB
|
||||||
*/
|
*/
|
||||||
exit(): void;
|
exit(): never;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy file between servers.
|
* Copy file between servers.
|
||||||
|
Loading…
Reference in New Issue
Block a user