Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Mar 21, 2024
1 parent f9d1cba commit 2726981
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions Hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 2726981

Please sign in to comment.