Fix mutating global item_groups in get_filler_item_name()#10
Merged
Alchav merged 1 commit intoAlchav:pokemon-rb-version-6from Feb 18, 2026
Merged
Fix mutating global item_groups in get_filler_item_name()#10Alchav merged 1 commit intoAlchav:pokemon-rb-version-6from
Alchav merged 1 commit intoAlchav:pokemon-rb-version-6from
Conversation
The `banned_items` variable was the `"Unique"`list within the
`item_groups` global. `get_filler_item_name()` could then mutate
`banned_items` through `banned_items.append("Poke Doll")` and
`banned_items += item_groups["Vending Machine Drinks"]`, causing
the contents of the `item_groups` global to be mutated.
This has been fixed by making `banned_items` a shallow copy of
`item_groups["Unique"]`.
Alchav
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
banned_itemsvariable was the"Unique"list within theitem_groupsglobal.get_filler_item_name()could then mutatebanned_itemsthroughbanned_items.append("Poke Doll")andbanned_items += item_groups["Vending Machine Drinks"], causing the contents of theitem_groupsglobal to be mutated.This has been fixed by making
banned_itemsa shallow copy ofitem_groups["Unique"].