Skip to content

Commit

Permalink
Core: Allow any valid priority location in yaml even when they are no…
Browse files Browse the repository at this point in the history
…t used in a given game. (ArchipelagoMW#2128)

* Allow any valid priority location in yaml.

For some games, the use location group name "Everywhere", results in the generator failing no matter what,  as only a subset of the location names will actually be present.  A good example of that is Zillion.  It has 21 location names per room, of which, only at most 2 is ever used.


Co-authored-by: Fabian Dill <[email protected]>
  • Loading branch information
2 people authored and FlySniper committed Nov 14, 2023
1 parent 4f73f28 commit 2429140
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
exclusion_rules(world, player, world.exclude_locations[player].value)
world.priority_locations[player].value -= world.exclude_locations[player].value
for location_name in world.priority_locations[player].value:
world.get_location(location_name, player).progress_type = LocationProgressType.PRIORITY
try:
location = world.get_location(location_name, player)
except KeyError as e: # failed to find the given location. Check if it's a legitimate location
if location_name not in world.worlds[player].location_name_to_id:
raise Exception(f"Unable to prioritize location {location_name} in player {player}'s world.") from e
else:
location.progress_type = LocationProgressType.PRIORITY

# Set local and non-local item rules.
if world.players > 1:
Expand Down

0 comments on commit 2429140

Please sign in to comment.