pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
257 stars 175 forks source link

KeyError: '' when opponent has a pokemon that likely has less than 4 moves #63

Closed Akkete closed 3 years ago

Akkete commented 3 years ago

The bot crashes with a KeyError when trying to list likely moves for a pokemon that often has the move Nothing or '' listed in the usage statistics.

For example when starting a battle against a team with Ditto.

File ".../showdown/battle.py", line 643, in __init__
    move_json = all_move_json[name]
KeyError: ''
pmariglia commented 3 years ago

Oh whoops, this was an oversight when changing the parse_smogon_stats logic to read from the chaos json.

'' would never show up for empty movesets in the text file, but it does in the JSON file.

Fixed in 0da17e6. Thanks for pointing this out!