rubenvereecken / pokemongo-api

Pokemon Go API for Python
Other
358 stars 120 forks source link

No Check for Full Pokemon Inventory #57

Closed kwkroll32 closed 8 years ago

kwkroll32 commented 8 years ago

It seems like there is no check for whether a trainer is at their max number of pokemon. I encountered this problem, and trainer.encounterAndCatch was unable to determine a "bestBall" or "altBall." The encounter itself clearly states that the trainer's pokemon list is full, but the program throws the, "out of usable balls," exception.

dnsBlah commented 8 years ago

I always do this check before I even do findnearpokemon

dnsBlah commented 8 years ago
if (len(session.inventory.party) + len(session.inventory.eggs)) < session.getProfile().player_data.max_pokemon_storage:
# Go search and catch pokemons
dmadisetti commented 8 years ago

Implemented https://github.com/rubenvereecken/pokemongo-api/blob/master/pogo/demo.py#L94