diff --git a/Fill.py b/Fill.py index df533c5e..77799168 100644 --- a/Fill.py +++ b/Fill.py @@ -191,14 +191,13 @@ def fill_restrictive(world, base_state, locations, itempool, single_player_place if world.accessibility[item_to_place.player] == 'none': perform_access_check = not world.has_beaten_game(maximum_exploration_state, item_to_place.player) if single_player_placement else not has_beaten_game - spot_to_fill = None for location in locations: if (not single_player_placement or location.player == item_to_place.player)\ and location.can_fill(maximum_exploration_state, item_to_place, perform_access_check): spot_to_fill = location break - if spot_to_fill is None: + else: # we filled all reachable spots. Maybe the game can be beaten anyway? unplaced_items.insert(0, item_to_place) if world.can_beat_game(): diff --git a/Mystery.py b/Mystery.py index d0045cac..32ccf234 100644 --- a/Mystery.py +++ b/Mystery.py @@ -140,8 +140,9 @@ def main(): def get_weights(path): try: - parsed_url = urllib.parse.urlparse(path) - if all(parsed_url.scheme, parsed_url.netloc, parsed_url.path): + if urllib.parse.urlparse(path).scheme: + yaml = str(urllib.request.urlopen(path).read(), "utf-8") + else: with open(path, 'rb') as f: yaml = str(f.read(), "utf-8") except Exception as e: