Merge pull request #423 from Kline-/fix-getActionTime

Fix bladeburner.getActionTime returning null
This commit is contained in:
danielyxie 2018-08-10 00:06:38 -05:00 committed by GitHub
commit 72bd1f22c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3424,12 +3424,7 @@ function NetscriptFunctions(workerScript) {
} }
updateDynamicRam("getCurrentAction", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 4); updateDynamicRam("getCurrentAction", CONSTANTS.ScriptBladeburnerApiBaseRamCost / 4);
if (Player.bladeburner instanceof Bladeburner && (Player.bitNodeN === 7 || hasBladeburner2079SF)) { if (Player.bladeburner instanceof Bladeburner && (Player.bitNodeN === 7 || hasBladeburner2079SF)) {
let res = Player.bladeburner.getTypeAndNameFromActionId(Player.bladeburner.action); return 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 " + 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"); "at the Bladeburner division or because you do not have Source-File 7");