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

@ -29371,7 +29371,12 @@ function NetscriptFunctions(workerScript) {
}
updateDynamicRam("getCurrentAction", _Constants__WEBPACK_IMPORTED_MODULE_6__[/* CONSTANTS */ "a"].ScriptBladeburnerApiBaseRamCost / 4);
if (_Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bladeburner instanceof _Bladeburner__WEBPACK_IMPORTED_MODULE_4__[/* Bladeburner */ "a"] && (_Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bitNodeN === 7 || hasBladeburner2079SF)) {
return _Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bladeburner.getTypeAndNameFromActionId(_Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bladeburner.action);
let res = _Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bladeburner.getTypeAndNameFromActionId(_Player__WEBPACK_IMPORTED_MODULE_16__[/* Player */ "a"].bladeburner.action);
if (res.type === "Idle" && res.name === "Idle") {
return null;
} else {
return res;
}
}
throw Object(_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_25__[/* makeRuntimeRejectMsg */ "d"])(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");

@ -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");