smogon / pokemon-showdown-client

The client for Pokémon Showdown
http://pokemonshowdown.com
GNU Affero General Public License v3.0
556 stars 781 forks source link

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

Open davidstone opened 3 years ago

davidstone commented 3 years ago

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 commented 3 years ago

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.

urkerab commented 3 years ago

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.