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

[BUGFIX] fix incorrect dict iteration causing crash #3390

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

rustykitty
Copy link
Contributor

About The Pull Request

changed .copy to .items on iterating a dict.

Why This Is Good For ClanGen

N/A

Linked Issues

fixes #3333

Proof of Testing

wasn't able to get the code to trigger. idk why

Changelog/Credits

@rustykitty rustykitty marked this pull request as ready for review January 28, 2025 03:06
@@ -789,7 +789,7 @@ def handle_herb_supply(self, block):

# adjust entire herb store
if supply_type == "all_herb":
for herb, count in herb_supply.entire_supply.items():
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems like this reverts the changes made in the first commit and described in the PR. Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops...

@@ -801,6 +801,7 @@ def handle_herb_supply(self, block):
herb_supply.remove_herb(herb, count / 8)
elif "increase" in adjustment:
herb_supply.add_herb(herb, adjustment.split("_")[1])
print("Ran without crashing yay")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Either update to a more useful comment or remove please (in context it makes sense but in an output log it's deeply unhelpful!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm planning to remove that print once I figure out how to get the code to trigger and successfully test the function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have made this PR a draft since you are not ready for it to be merged in. Please revert it to open when you have tested and are comfortable with the changes made!

@j-gynn j-gynn marked this pull request as draft February 2, 2025 22:48
@rustykitty rustykitty changed the title fix dict iteration [BUGFIX] fix dict iteration Feb 6, 2025
@rustykitty rustykitty changed the title [BUGFIX] fix dict iteration [BUGFIX] fix incorrect dict iteration causing crash Feb 6, 2025
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.

[BUG] crash upon moon skipping (related to herbs)
3 participants