Core: Allow any valid priority location in yaml even when they are not used in a given game. (#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 <Berserker66@users.noreply.github.com>
This commit is contained in:
parent
794959e182
commit
4a27fae1ab
8
Main.py
8
Main.py
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue