Skip to content

Commit

Permalink
Fix #3411. Update inventory info before every catch try otherwise old…
Browse files Browse the repository at this point in the history
… values used
  • Loading branch information
cmezh committed Aug 10, 2016
1 parent 99187ab commit f7678da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pokemongo_bot/cell_workers/pokemon_catch_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False):
maximum_ball = ITEM_ULTRABALL if is_vip else ITEM_GREATBALL
ideal_catch_rate_before_throw = 0.9 if is_vip else 0.35

berry_count = self.bot.item_inventory_count(berry_id)
items_stock = self.bot.current_inventory()

while True:

self.bot.latest_inventory = None
berry_count = self.bot.item_inventory_count(berry_id)
items_stock = self.bot.current_inventory()

# find lowest available ball
current_ball = ITEM_POKEBALL
while items_stock[current_ball] == 0 and current_ball < maximum_ball:
Expand Down

0 comments on commit f7678da

Please sign in to comment.