Skip to content
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

Do not try to transfer buddy #5752

Merged
merged 6 commits into from
Oct 4, 2016
Merged

Do not try to transfer buddy #5752

merged 6 commits into from
Oct 4, 2016

Conversation

Gobberwart
Copy link
Contributor

Short Description:

Transfer attempt of buddy pokemon currently fails and results in endless transfer loop. Added check to both TransferPokemon and PokemonOptimizer to skip trying to transfer buddy pokemon.

Fixes/Resolves/Closes (please use correct syntax):

@mention-bot
Copy link

@Gobberwart, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LitRidl, @achretien and @anakin5 to be potential reviewers.

@Gobberwart Gobberwart changed the title Check for buddy before transfer Do not try to transfer buddy Oct 3, 2016
@@ -31,7 +32,7 @@ def work(self):

if self.bot.config.release.get('all'):
group = [p for p in inventory.pokemons().all()
if p.in_fort is False and p.is_favorite is False]
if not p.in_fort and not p.is_favorite and not (p.unique_id == self.buddy['id'])]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no buddy, self.buddy['id'] will give an error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Give me a few minutes.

# Conflicts:
#	pokemongo_bot/cell_workers/pokemon_optimizer.py
#	pokemongo_bot/cell_workers/transfer_pokemon.py
@Gobberwart
Copy link
Contributor Author

OK that should take care of buddy not set situation. @DeXtroTip, thoughts?

@DeXtroTip
Copy link
Contributor

It could have been something like p.unique_id == self.buddy.get('id', 0), i think. But yeah, it's okay now

@Gobberwart
Copy link
Contributor Author

I thought about that, but figured it might still generate an error if NoneType isn't iterable. Then I thought about over-complicating that one line and just decided to palm it off to another method.

@Gobberwart
Copy link
Contributor Author

If you're happy with this change @DeXtroTip could you please approve for merge?

@Gobberwart Gobberwart merged commit 5d2338e into PokemonGoF:dev Oct 4, 2016
@Gobberwart Gobberwart deleted the gobb_buddyxfer branch November 9, 2016 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants