Skip to content

Commit 0188210

Browse files
committed
Fix an issue that would cause goal weights not to be set for world other than world 0
1 parent 39fb4a5 commit 0188210

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Goals.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ def update_goal_items(spoiler: Spoiler) -> None:
258258
woth_locations = list(required_locations['way of the hero'])
259259
del required_locations['way of the hero']
260260

261+
# Update category and goal weights that have required locations
262+
for category_name, goals in required_locations.items():
263+
for goal_name, goal_worlds in goals.items():
264+
for world_id, locations in goal_worlds.items():
265+
worlds[world_id].goal_categories[category_name].weight = 1
266+
worlds[world_id].goal_categories[category_name].get_goal(goal_name).weight = 1
267+
261268
# Generate location requirements for each WOTH location
262269
requirements_by_world = {}
263270
requirements = search_required_locations(woth_locations, woth_locations, worlds)
@@ -398,8 +405,7 @@ def search_goals(categories: dict[str, GoalCategory], reachable_goals: ValidGoal
398405
else:
399406
location_weights = (location, 1, 1)
400407
required_locations[category.name][goal.name][world_id].append(location_weights)
401-
goal.weight = 1
402-
category.weight = 1
408+
403409
# Locations added to goal exclusion for future categories
404410
# Main use is to split goals between before/after rainbow bridge
405411
# Requires goal categories to be sorted by priority!

0 commit comments

Comments
 (0)