mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 00:04:22 +02:00
Unify error handling
This commit is contained in:
@@ -12,7 +12,6 @@ import { GetServer } from "../Server/AllServers";
|
||||
|
||||
import { errorDialog } from "../ui/React/DialogBox";
|
||||
import { AddRecentScript } from "./RecentScripts";
|
||||
import { Player } from "../Player";
|
||||
import { ITutorial } from "../InteractiveTutorial";
|
||||
import { AlertEvents } from "../ui/React/AlertManager";
|
||||
|
||||
@@ -102,8 +101,8 @@ function removeWorkerScript(workerScript: WorkerScript): void {
|
||||
|
||||
// Recalculate ram used on that server
|
||||
|
||||
server.updateRamUsed(0, Player);
|
||||
for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads, Player);
|
||||
server.updateRamUsed(0);
|
||||
for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads);
|
||||
|
||||
// Delete script from global pool (workerScripts)
|
||||
workerScripts.delete(workerScript.pid);
|
||||
|
||||
Reference in New Issue
Block a user