Updated WorkerScript-related code for the workerScripts array->map change

This commit is contained in:
danielyxie
2019-06-19 01:51:25 -07:00
committed by danielyxie
parent 821725cf4d
commit 4cc6437408
6 changed files with 83 additions and 78 deletions
+3 -3
View File
@@ -2178,7 +2178,7 @@ function NetscriptFunctions(workerScript) {
// First element is total income of all currently running scripts
let total = 0;
for (const script of workerScripts) {
for (const script of workerScripts.values()) {
total += (script.scriptRef.onlineMoneyMade / script.scriptRef.onlineRunningTime);
}
res.push(total);
@@ -2209,8 +2209,8 @@ function NetscriptFunctions(workerScript) {
updateDynamicRam("getScriptExpGain", getRamCost("getScriptExpGain"));
if (arguments.length === 0) {
var total = 0;
for (var i = 0; i < workerScripts.length; ++i) {
total += (workerScripts[i].scriptRef.onlineExpGained / workerScripts[i].scriptRef.onlineRunningTime);
for (const ws of workerScripts.values()) {
total += (ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime);
}
return total;
} else {