-
Notifications
You must be signed in to change notification settings - Fork 521
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
base: development
Are you sure you want to change the base?
Conversation
@@ -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(): |
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 seems like this reverts the changes made in the first commit and described in the PR. Is this intentional?
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.
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") |
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.
Either update to a more useful comment or remove please (in context it makes sense but in an output log it's deeply unhelpful!)
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.
I'm planning to remove that print once I figure out how to get the code to trigger and successfully test the function.
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.
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!
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