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: Hackchance gets NaN at high skill values #1349

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

Caldwell-74
Copy link
Contributor

@Caldwell-74 Caldwell-74 commented Jun 4, 2024

const skillMult = hackFactor * person.skills.hacking
this part of the hackchance calculation can get to Infinity on high stats (hackFactor is 1.7)
the skillChance then gets to NaN when
(skillMult - requiredHackingSkill) / skillMultt;
is calculated (results to Infinity/Infinity)
this pr clamps skillMult to not get Infinity to prevent the NaN

@d0sboots d0sboots merged commit c42d414 into bitburner-official:dev Jun 5, 2024
6 checks passed
@Caldwell-74 Caldwell-74 deleted the hackchance branch June 5, 2024 18:40
antoinedube pushed a commit to antoinedube/bitburner-source that referenced this pull request Aug 5, 2024
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