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

Patch/poke env - fixes the NoneType error when battling #41

Merged
merged 4 commits into from
Jun 20, 2023

Conversation

@AoifeHughes AoifeHughes requested a review from phinate June 20, 2023 09:20
@AoifeHughes AoifeHughes marked this pull request as ready for review June 20, 2023 09:47
@@ -18,7 +20,7 @@

class Team:
def __init__(self, pokemon) -> None:
self.pokemon = np.array(pokemon)
self.pokemon = np.array(deepcopy(pokemon))
Copy link
Collaborator

Choose a reason for hiding this comment

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

was not deep-copying causing some hidden state mutation or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so, basically when a team was being created it had a situation where 2 Pokemon in a team (or even against each other in the same match) could be affecting each other's state!

@AoifeHughes AoifeHughes merged commit b22a754 into main Jun 20, 2023
@AoifeHughes AoifeHughes deleted the patch/poke-env branch June 20, 2023 18:23
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.

2 participants