-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot treats all pokemon as VIP fix #5494
Conversation
@Gobberwart, thanks for your PR! By analyzing the annotation information on this pull request, we identified @DBa2016, @xc-mezcal and @pokepal to be potential reviewers |
Replaces #5479 |
If catch_above_cp (or other rule) set to 0, was not returning true.
|
@@ -44,6 +44,7 @@ | |||
'andor': lambda x, y, z: x and y or z | |||
} | |||
|
|||
DEBUG_ON = False | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably just a small issue, but should we introduce another debug flag here? We already have a debug flag in config now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this flag only applies to this rather than using global debug which generates a lot of garbage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok noted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not unusual. A lot of other code has the same thing. It's actually really handy when debugging a single module.
@anakin5 That's correct as it stands... The bot really shouldn't use a rule if it's not defined in config. Let me take a look. |
@anakin5 I've added some logic to handle different default values based on catch logic. It's mucky but should account for all configurations. Having said that, the current LOGIC_TO_FUNCTION only works if there are exactly three values. Would be much better if we could only compare what's actually set in config and ignore whatever is not set. Leaving as-is for now so we can make the bot work properly again. |
please merge these changes to master branch. I have updated every day since these commits but still have this issue on master branch |
Short Description:
Bot treats all pokemon as VIP. Additionally, default rules always return true if not configured. For example:
Given example pokemon with cp 30, iv 0.2 and ncp 0.15, the bot would still always catch it because no "catch_above_ncp" rule is defined. This is incorrect behaviour, should return false if no condition matches or condition doesn't exist.
Fixes/Resolves/Closes (please use correct syntax):