Fix MW goal hint weight initialization and add regression test#2539
Merged
fenhl merged 1 commit intoMar 16, 2026
Merged
Conversation
Move goal/category weight assignment out of search_goals and set weights per actual world_id from required_locations in update_goal_items Prevent world 0 category objects from incorrectly owning all weight updates in multiworld Add test_multiworld_goal_weights_initialized_per_world to verify worlds > 0 get goal/category weights set when they have required goal locations Keep one-hint-per-goal behavior covered with existing tests
fenhl
approved these changes
Mar 16, 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.
Fixes a multiworld goal-hint weighting bug where goal/category weights were being set on world 0 goal objects during required-location search, leaving worlds > 0 with zeroed weights.
What changed
search_goals.update_goal_itemsusing theworld_idfrom discovered required locations:worlds[world_id].goal_categories[category_name].weight = 1worlds[world_id].goal_categories[category_name].get_goal(goal_name).weight = 1Unittest.TestHints.test_multiworld_goal_weights_initialized_per_world1.This preserves existing behavior for single-world while restoring correct per-world weighting for multiworld goal hint selection.
Testing
py -3 -m unittest Unittest.TestHints.test_multiworld_goal_weights_initialized_per_worldpy -3 -m unittest Unittest.TestHints.test_one_hint_per_goal