Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Sleeves UI shows and sets wrong task #1807

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

catloversg
Copy link
Contributor

This PR fixes 2 bugs.

Bug 1:
How to reproduce it:

  • Set a sleeve's task to non-Idle.
  • Switch to another tab, then switch back to Sleeves tab.
  • The current task is correct, but when you press "Set Task", the current task is always set to Idle, regardless of the current task.

Bug 2:
Test code:

function getRandomIntInclusive(min, max) {
  if (min > max) {
    throw new Error(`Min is greater than max. Min: ${min}. Max: ${max}.`);
  }
  return Math.floor(Math.random() * (max - min + 1) + min);
}

/** @param {NS} ns */
export async function main(ns) {
  ns.tail();
  switch (getRandomIntInclusive(0, 7)) {
    case 0:
      ns.print("setToIdle");
      ns.sleeve.setToIdle(0);
      break;
    case 1:
      ns.print("setToSynchronize");
      ns.sleeve.setToSynchronize(0);
      break;
    case 2:
      ns.print("Crime Shoplift");
      ns.sleeve.setToCommitCrime(0, "Shoplift");
      break;
    case 3:
      ns.print("Crime Mug");
      ns.sleeve.setToCommitCrime(0, "Mug");
      break;
    case 4:
      ns.print("Gym str");
      ns.sleeve.setToGymWorkout(0, "Powerhouse Gym", "str");
      break;
    case 5:
      ns.print("Gym agi");
      ns.sleeve.setToGymWorkout(0, "Powerhouse Gym", "agi");
      break;
    case 6:
      ns.print("Bladeburner Chamber");
      ns.sleeve.setToBladeburnerAction(0, "Hyperbolic Regeneration Chamber");
      break;
    case 7:
      ns.print("Bladeburner Tracking");
      ns.sleeve.setToBladeburnerAction(0, "Take on contracts", "Tracking");
      break;
  }
}

How to reproduce it:

  • Open Sleeves tab.
  • Run test code.
  • "Earnings" and the description are changed, but 3 dropdown inputs stay the same.

@d0sboots We are going to release v2.7.0 soon. I updated the changelog to reflect the latest change (this PR and #1806). Maybe I'll also update the changelog in my bugfix PRs until Snarling releases the new version. If you want me to move the change in changelog to other PRs, I'll revert the change in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants