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

Hidden Power calculation using only IV input #4

Closed
Snowysauce opened this issue Oct 4, 2016 · 2 comments
Closed

Hidden Power calculation using only IV input #4

Snowysauce opened this issue Oct 4, 2016 · 2 comments
Labels

Comments

@Snowysauce
Copy link
Collaborator

If you load a fresh version of the calculator (whether by going to the page for the first time or refreshing the page) and input a set of IVs, check the "Lock Median" option, and click "Calculate Hidden Power", the calculation never finishes, with the status display showing only "Calculating Hidden Power..."

If you follow the same steps with the GenIII-V calculator, the calculation does finish and you get Hidden Power's type and power for those IVs.

The calculation finishes on the modern (XY) calculator only if the IVs were generated by inputting a Pokémon's stat values.

After doing some tests, I believe the problem is caused by p.sortnum(); on line 915, a remnant of the pre-GenVI code for calculating Hidden Power's base power. When the function display_hp() is called at line 927, p is undefined, causing p.sortnum(); in display_hp() to fail and as a result display_hp() never completes. However, when display_hp() is called at line 962, p is defined (on line 931), allowing display_hp() to complete.

I've found two potential fixes:

  • Uncommenting line 926, giving p a value of [60]
  • p.sortnum(); could be commented out in display_hp() since the value of p is no longer used
@Arty2 Arty2 added the bug label Oct 5, 2016
@Arty2
Copy link
Collaborator

Arty2 commented Oct 5, 2016

@Snowysauce Thank you for the bug hunting! Do you think you could submit a pull request for that one?

@Snowysauce
Copy link
Collaborator Author

I submitted a pull request as requested. I chose to make the second fix and comment out p.sortnum(); on line 915.

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

No branches or pull requests

2 participants