smogon / pokemon-showdown-client

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

PP Shows Negative if Stalled to 0 from an Odd Number, Against Pressure Ability #1740

Open test123 opened 3 years ago

test123 commented 3 years ago

If we PP stall a Pokémon's move with an odd number of PP left, facing off a Pokémon with the Pressure ability, bring it down to 0 count, and hover over it to generate the tooltip, the remaining PP count will show -1.

To replicate this issue, we will use:

Team 1

Articuno @ Aguav Berry  
Ability: Pressure  
EVs: 252 Atk / 252 Spe  
Timid Nature  
IVs: 0 Atk  
- Substitute  
- Roost  

Shedinja @ Colbur Berry  
Ability: Wonder Guard  
EVs: 252 Atk  
Adamant Nature  
- Facade  

Team 2

Relicanth @ Wiki Berry  
Ability: Rock Head  
EVs: 252 HP / 252 SpD  
Brave Nature  
- Head Smash  

The specifics do not matter. All we care about is:

We choose Head Smash, because it has 8 PP and can run out really quickly.

Steps to Reproduce

Turn 0:

Turn 1:

Turn 3:

Turn 4:

Turn 5:

Turn 6:

Turn 7: Hover over Relicanth's sprite, the PP Count will say -1.

Example of Error:

https://replay.pokemonshowdown.com/gen8customgame-1313171013-v0bh2mj6ovmf2cn2qhkutdyudls4zdfpw

test123 commented 3 years ago

Created a Pull request, here: https://github.com/smogon/pokemon-showdown-client/pull/1741

test123 commented 3 years ago

Important Note: This issue is only on the tooltip, because the move selector shows 0 PP, if Relicanth has multiple moves.