Bot attempts to use Razz Berries when you do not have any.
Expected Behavior
Bot would not try to use a Razz Berry when I have 0
Actual Behavior
[00:03:38] Using Pokeball (chance: 46.39%)... (49 left!) [00:03:39] [-] Attempted to capture Paras - failed.. trying again! [00:03:41] Catch Rate with normal Pokeball is low (46.39%). Throwing Razz Berry... (0 left!) [00:03:41] Fail to use berry. Status Code: 3 [00:03:41] Using Pokeball (chance: 46.39%)... (48 left!) [00:03:41] [-] Attempted to capture Paras - failed.. trying again! [00:03:43] Catch Rate with normal Pokeball is low (46.39%). Throwing Razz Berry... (0 left!) [00:03:44] Fail to use berry. Status Code: 3 [00:03:44] Using Pokeball (chance: 46.39%)... (47 left!) [00:03:44] [-] Attempted to capture Paras - failed.. trying again! [00:03:47] Catch Rate with normal Pokeball is low (46.39%). Throwing Razz Berry... (0 left!) [00:03:47] Fail to use berry. Status Code: 3 [00:03:47] Using Pokeball (chance: 46.39%)... (46 left!)
Steps to Reproduce
Have zero razz berries when you encounter a pokemon
Other Information
OS: Ubuntu 14.04.4 LTS Linux 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Git Commit: 93dbca6a480476423b28ff106261f48b67a74840
This hasn't happened since...I'm not sure under what edge condition this happened (or even could), I took a look at the code, and it's pretty straight-forward; this shouldn't have happened.
I'll try to keep an eye on it and hopefullly be able to get something more concrete.
It happens generally if you have less razzes than you use to catch that one pokemon. Since the catch attempts are in a loop, and inventory isn't updated inside that loop. It should substract one from the amount of the berries whenever it uses one, like the Pokeball code does.
There's a patch for it now, though, but yes it's a real problem as far as log and bot-like behaviour are concerned :)
@Donwulff Ah! I see it now. It just happened to me again; it had one berry, and so it used that one, and then another (that it didn't have). I also see the PR that was referenced.
Thanks!