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

IVs of 0 are read as 31 by correctHiddenPower #663

Open
ctl2 opened this issue Oct 31, 2024 · 1 comment
Open

IVs of 0 are read as 31 by correctHiddenPower #663

ctl2 opened this issue Oct 31, 2024 · 1 comment

Comments

@ctl2
Copy link

ctl2 commented Oct 31, 2024

This line doesn't differentiate between IV values of 0 and undefined

var iv = ivs[legacyStatToStat(s)] = (pokemon.ivs && pokemon.ivs[s]) || 31;

This is an issue for any pre gen 7 set with hidden power in its moveset & 1 or more IVs of 0. The gen 5 Bronzong (OU Tank) set should have a speed IV of 0, but gets assigned 31 instead (which has a big effect on its gyro ball damage).

Can be fixed by changing the line's || to ??.

@ctl2
Copy link
Author

ctl2 commented Oct 31, 2024

also, nbd but I think the for loop's condition should be < rather than <=

for (var i = 0; i <= LEGACY_STATS[9].length; i++) {

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

No branches or pull requests

1 participant