BUGFIX: Contracts now fail if there are 0 of them remaining (#889)

This commit is contained in:
TheAimMan
2023-10-30 03:11:51 -04:00
committed by GitHub
parent 0bdab7bec8
commit 2a149df13e
2 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -1663,7 +1663,13 @@ export class Bladeburner {
if (!this.action) {
throw new Error("Bladeburner.action is not an ActionIdentifier Object");
}
//Check to see if action is a contract, and then to verify a sleeve didn't finish it first
if (this.action.type === 2) {
const remainingActions = this.contracts[this.action.name].count;
if (remainingActions < 1) {
return this.resetAction();
}
}
// If the previous action went past its completion time, add to the next action
// This is not added immediately in case the automation changes the action
this.actionTimeCurrent += seconds + this.actionTimeOverflow;