diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index eb839e977e..d29bc5f801 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -340,6 +340,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): if self.min_ultraball_to_keep >= 0 and self.min_ultraball_to_keep < min_ultraball_to_keep: min_ultraball_to_keep = self.min_ultraball_to_keep + used_berry = False while True: # find lowest available ball @@ -367,9 +368,8 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): berries_to_spare = berry_count > 0 if is_vip else berry_count > num_next_balls + 30 # use a berry if we are under our ideal rate and have berries to spare - used_berry = False changed_ball = False - if catch_rate_by_ball[current_ball] < ideal_catch_rate_before_throw and berries_to_spare: + if catch_rate_by_ball[current_ball] < ideal_catch_rate_before_throw and berries_to_spare and not used_berry: new_catch_rate_by_ball = self._use_berry(berry_id, berry_count, encounter_id, catch_rate_by_ball, current_ball) if new_catch_rate_by_ball != catch_rate_by_ball: catch_rate_by_ball = new_catch_rate_by_ball @@ -451,6 +451,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): formatted='{pokemon} capture failed.. trying again!', data={'pokemon': pokemon.name} ) + used_berry = False # sleep according to flee_count and flee_duration config settings # randomly chooses a number of times to 'show' wobble animation between 1 and flee_count