Delete Active Scripts actually deletes active scripts on all servers, not just home

This commit is contained in:
Olivier Gagnon 2021-05-05 18:58:53 -04:00
parent 7d6d0eac32
commit f7c1d64033
2 changed files with 8 additions and 6 deletions

@ -63,7 +63,7 @@ import {
scriptEditorInit,
updateScriptEditorContent,
} from "./Script/ScriptHelpers";
import { initForeignServers } from "./Server/AllServers";
import { initForeignServers, AllServers } from "./Server/AllServers";
import { Settings } from "./Settings/Settings";
import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags";
import { initSpecialServerIps } from "./Server/SpecialServerIps";
@ -1542,8 +1542,10 @@ const Engine = {
// DEBUG Delete active Scripts on home
document.getElementById("debug-delete-scripts-link").addEventListener("click", function() {
Player.getHomeComputer().runningScripts = [];
dialogBoxCreate("Forcefully deleted all running scripts on home computer. Please save and refresh page");
for(const hostname of Object.keys(AllServers)) {
AllServers[hostname].runningScripts = [];
}
dialogBoxCreate("Forcefully deleted all running scripts. Please save and refresh page.");
gameOptionsBoxClose();
return false;
});

@ -600,14 +600,14 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %>
Copy Save data to Clipboard
</button>
<button id="debug-delete-scripts-link" class="a-link-button tooltip">
(DEBUG) Delete Active Scripts
Delete all active scripts
<span class="tooltiptextleft">
Debug option used to forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game. After
Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game. After
using this, save the game and then reload the page.
</span>
</button>
<button id="debug-soft-reset" class="a-link-button tooltip">
(DEBUG) Soft Reset
Soft Reset
<span class="tooltiptextleft">
Perform a soft reset. Resets everything as if you had just purchased an Augmentation.
</span>