Small bug in pokemon_catch_worker.py
My pokeball and greatball have run out, I have over 200 ultraballs, my inventory is full.
Expected Behavior
Should use ultraball to catch normal pokemon.
Actual Behavior
Stuck in looping "No usable pokeballs found!"
Root cause:
In pokemon_catch_worker.py _do_catch
In case pokeball and greatball have run out, maxinum_ball is set to be greatball in this line:
maximum_ball = ITEM_ULTRABALL if is_vip else ITEM_GREATBALL
Then
while items_stock[current_ball] == 0 and current_ball < maximum_ball: current_ball += 1
will never let current_ball to be ultraball
Fix
Change
while items_stock[current_ball] == 0 and current_ball < maximum_ball:
To
while items_stock[current_ball] == 0 and current_ball < ITEM_ULTRABALL:
I already PR to fix that issue. fixes #3421