pokemon-showdown-client icon indicating copy to clipboard operation
pokemon-showdown-client copied to clipboard

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

Open davidstone opened this issue 3 years ago • 3 comments

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.

davidstone avatar Jun 21 '21 18:06 davidstone

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

https://github.com/smogon/pokemon-showdown-client/blob/d4f526eebab46ab96a713ce16f2c14265ee9611f/js/client-teambuilder.js#L2442-L2444

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.

Zarel avatar Jun 21 '21 18:06 Zarel

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.

urkerab avatar Jun 21 '21 23:06 urkerab