From 27269810162e1159b6ac825f3b9d2b5d1bfefd48 Mon Sep 17 00:00:00 2001 From: Fenhl Date: Tue, 26 Sep 2023 01:57:39 +0000 Subject: [PATCH] Fix #2085 --- Fill.py | 2 -- Hints.py | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Fill.py b/Fill.py index ff1229c9c..6c018f94e 100644 --- a/Fill.py +++ b/Fill.py @@ -149,8 +149,6 @@ def distribute_items_restrictive(worlds: list[World], fill_locations: Optional[l if location.world.empty_dungeons[HintArea.at(location).dungeon_name].empty] for location in empty_locations: fill_locations.remove(location) - location.world.hint_type_overrides['sometimes'].append(location.name) - location.world.hint_type_overrides['random'].append(location.name) if worlds[0].settings.shuffle_mapcompass in ['any_dungeon', 'overworld', 'keysanity', 'regional']: # Non-empty dungeon items are present in restitempool but yet we diff --git a/Hints.py b/Hints.py index f21d3fb13..d9324fd2f 100644 --- a/Hints.py +++ b/Hints.py @@ -932,7 +932,8 @@ def get_random_location_hint(spoiler: Spoiler, world: World, checked: set[str]) and not location.locked and location.name not in world.hint_exclusions and location.name not in world.hint_type_overrides['item'] - and location.item.name not in world.item_hint_type_overrides['item'], + and location.item.name not in world.item_hint_type_overrides['item'] + and (location.world.settings.empty_dungeons_mode == 'none' or not location.world.empty_dungeons[HintArea.at(location).dungeon_name].empty), world.get_filled_locations())) if not locations: return None @@ -951,8 +952,16 @@ def get_random_location_hint(spoiler: Spoiler, world: World, checked: set[str]) def get_specific_hint(spoiler: Spoiler, world: World, checked: set[str], hint_type: str) -> HintReturn: + def is_valid_hint(hint: Hint) -> bool: + location = world.get_location(hint.name) + if not is_not_checked([world.get_location(hint.name)], checked): + return False + if location.world.settings.empty_dungeons_mode != 'none' and location.world.empty_dungeons[HintArea.at(location).dungeon_name].empty: + return False + return True + hint_group = get_hint_group(hint_type, world) - hint_group = list(filter(lambda hint: is_not_checked([world.get_location(hint.name)], checked), hint_group)) + hint_group = list(filter(is_valid_hint, hint_group)) if not hint_group: return None