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

Cannot use right arrow to increase EV if 4 more EVs would not increase stat #1827

Open
davidstone opened this issue Jun 21, 2021 · 3 comments

Comments

@davidstone
Copy link

Tested on Firefox on Linux.

Example reproduction: Generation 2, Species Sunflora, Level 80. Set Attack EV to 240. Click on the slider bar bulb. Left arrow reduces EVs by 4, but right arrow does nothing.

@Zarel
Copy link
Member

Zarel commented Jun 21, 2021

I understand what's going on. Right increases by 4, and then the change handler rounds down:

if (supportsEVs) {
while (val > 0 && this.getStat(stat, set, val - 4) == result) val -= 4;
}

The change handler should round away from the previous value, instead. This would require grabbing the previous value but it can be grabbed directly from set or the numeric input.

@urkerab
Copy link
Contributor

urkerab commented Jun 21, 2021

Although you do have to worry about the edge case where you don't have enough EVs left to be able to increase the stat.

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

4 participants
@Zarel @davidstone @urkerab and others