Bladeburner API getCurrentAction() now returns null if current action is 'Idle'

This commit is contained in:
danielyxie
2018-07-15 20:39:07 -05:00
parent c449dee97e
commit a605dd4491
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -3261,7 +3261,12 @@ function NetscriptFunctions(workerScript) {
}
updateDynamicRam("getCurrentAction", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 4);
if (Player.bladeburner instanceof Bladeburner && (Player.bitNodeN === 7 || hasBladeburner2079SF)) {
return Player.bladeburner.getTypeAndNameFromActionId(Player.bladeburner.action);
let res = Player.bladeburner.getTypeAndNameFromActionId(Player.bladeburner.action);
if (res.type === "Idle" && res.name === "Idle") {
return null;
} else {
return res;
}
}
throw makeRuntimeRejectMsg(workerScript, "getCurrentAction() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed " +
"at the Bladeburner division or because you do not have Source-File 7");