Added more error line numbers to JS Interpreter. Reputation needed for megacorp faction reduced from 250k -> 200k. Fixed bladeburner.getActionobject() bug with general actions

This commit is contained in:
danielyxie
2018-07-27 19:00:57 -05:00
parent 47134a9640
commit b34057f2d3
8 changed files with 63 additions and 31 deletions
+4 -2
View File
@@ -300,7 +300,9 @@ function NetscriptFunctions(workerScript) {
const percentHacked = scriptCalculatePercentMoneyHacked(server);
let maxThreadNeeded = Math.ceil(1/percentHacked*(server.moneyAvailable/server.moneyMax));
if (isNaN(maxThreadNeeded)) {
maxThreadNeeded = 1e6; //Server has a 'max money' of 0 (probably)
//Server has a 'max money' of 0 (probably).
//We'll set this to an arbitrarily large value
maxThreadNeeded = 1e6;
}
let moneyGained = Math.floor(server.moneyAvailable * percentHacked) * threads;
@@ -3046,7 +3048,7 @@ function NetscriptFunctions(workerScript) {
const crime = findCrime(crimeRoughName.toLowerCase());
if(crime == null) { // couldn't find crime
throw makeRuntimeRejectMsg(workerScript, "Invalid crime passed into commitCrime(): " + crime);
throw makeRuntimeRejectMsg(workerScript, "Invalid crime passed into commitCrime(): " + crimeRoughName);
}
if(workerScript.disableLogs.ALL == null && workerScript.disableLogs.commitCrime == null) {
workerScript.scriptRef.log("Attempting to commit crime: "+crime.name+"...");