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

MISC: Do not round return value of getBonusTime APIs #1961

Conversation

catloversg
Copy link
Contributor

This PR implements the change mentioned at #1924 (comment).

For more information, please check that issue and https://discord.com/channels/415207508303544321/415213413745164318/1332268782735065171.

Test code:

/** @param {NS} ns */
async function loopBBNextUpdate(ns) {
  while (true) {
    await ns.bladeburner.nextUpdate();
    console.log(new Date().toISOString(), "BB nextUpdate");
  }
}

/** @param {NS} ns */
export async function main(ns) {
  ns.clearLog();
  console.clear();
  await ns.bladeburner.nextUpdate();
  Player.bladeburner.storedCycles = 0; // debug code
  loopBBNextUpdate(ns);
  while (true) {
    console.log(new Date().toISOString(), ns.bladeburner.getBonusTime(), Player.bladeburner.storedCycles)
    await ns.asleep(100);
  }
}

Before:
before

After:
after

@d0sboots d0sboots merged commit 13990fb into bitburner-official:dev Feb 16, 2025
5 checks passed
@catloversg catloversg deleted the pull-request/misc/do-not-round-return-value-of-getBonusTime-APIs branch February 16, 2025 14:25
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