Skip to content

Commit ad46d9f

Browse files
committed
Merge 'Fix misc. location hints not being counted as always hints' (#2391)
2 parents 45b5a0a + fa8f63e commit ad46d9f

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* Fix the code that checks whether a hint is reachable not taking effective starting items (e.g. the rewards of precompleted dungeons) into account.
2626
* Pause menu has been modified to more closely align equip swap behavior with the vanilla game, while also removing some cursor movement restrictions.
2727
* Fix the texture of the rotated Forest Temple boss key chest when `Chest Appearance Matches Content` is off.
28+
* Misc. location hints no longer prevent their area from being hinted as Barren.
29+
* Fix a generator failure when a `named_items_required` Named Item hint conflicts with a misc. location hint.
2830

2931
## Other changes
3032
* Big poe souls can now be collected while riding Epona.

Hints.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,20 +1278,10 @@ def build_bingo_hint_list(board_url: str) -> list[str]:
12781278
return hints
12791279

12801280

1281-
def always_named_item(world: World, locations: Iterable[Location]):
1282-
for location in locations:
1283-
if location.item.name in bingoBottlesForHints and world.settings.hint_dist == 'bingo':
1284-
always_item = 'Bottle'
1285-
else:
1286-
always_item = location.item.name
1287-
if always_item in world.named_item_pool and world.settings.world_count == 1:
1288-
world.named_item_pool.remove(always_item)
1289-
1290-
12911281
def build_gossip_hints(spoiler: Spoiler, worlds: list[World]) -> None:
12921282
from Dungeon import Dungeon
12931283

1294-
checked_locations = dict()
1284+
checked_locations = {}
12951285
# Add misc. item hint locations to "checked" locations if the respective hint is reachable without the hinted item.
12961286
for world in worlds:
12971287
for location in world.hinted_dungeon_reward_locations.values():
@@ -1349,16 +1339,16 @@ def build_gossip_hints(spoiler: Spoiler, worlds: list[World]) -> None:
13491339
item_world = location.world
13501340
if item_world.id not in checked_locations:
13511341
checked_locations[item_world.id] = {}
1352-
mark_checked(checked_locations[item_world.id], location.name)
1342+
mark_checked(checked_locations[item_world.id], location.name, CheckedKind.ALWAYS)
13531343

13541344
# Build all the hints.
13551345
for world in worlds:
13561346
world.update_useless_areas(spoiler)
1357-
build_world_gossip_hints(spoiler, world, checked_locations.pop(world.id, None))
1347+
build_world_gossip_hints(spoiler, world, checked_locations.pop(world.id, {}))
13581348

13591349

13601350
# builds out general hints based on location and whether an item is required or not
1361-
def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations: Optional[dict[HintArea | str, set[CheckedKind]]] = None) -> None:
1351+
def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations: dict[HintArea | str, set[CheckedKind]]) -> None:
13621352
world.barren_dungeon = 0
13631353
world.woth_dungeon = 0
13641354

@@ -1368,9 +1358,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
13681358
search.spot_access(world.get_location(stone.location))
13691359
and search.state_list[world.id].guarantee_hint())
13701360

1371-
if checked_locations is None:
1372-
checked_locations = {}
1373-
13741361
stone_ids = list(gossipLocations.keys())
13751362

13761363
world.distribution.configure_gossip(spoiler, stone_ids)
@@ -1491,8 +1478,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
14911478
mark_checked(checked_locations, first_location.name, CheckedKind.ALWAYS)
14921479
mark_checked(checked_locations, second_location.name, CheckedKind.ALWAYS)
14931480

1494-
always_named_item(world, [first_location, second_location])
1495-
14961481
if hint.name in world.hint_text_overrides:
14971482
location_text = world.hint_text_overrides[hint.name]
14981483
else:
@@ -1514,8 +1499,6 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
15141499
location = world.get_location(hint.name)
15151500
mark_checked(checked_locations, hint.name, CheckedKind.ALWAYS)
15161501

1517-
always_named_item(world, [location])
1518-
15191502
if location.name in world.hint_text_overrides:
15201503
location_text = world.hint_text_overrides[location.name]
15211504
else:
@@ -1572,6 +1555,18 @@ def build_world_gossip_hints(spoiler: Spoiler, world: World, checked_locations:
15721555

15731556
# Add user-specified hinted item locations if using a built-in hint distribution
15741557
# Raise error if hint copies is zero
1558+
for location_name, kinds in checked_locations.items():
1559+
if CheckedKind.ALWAYS in kinds:
1560+
try:
1561+
location = world.get_location(location_name)
1562+
except KeyError:
1563+
continue
1564+
if location.item.name in bingoBottlesForHints and world.settings.hint_dist == 'bingo':
1565+
always_item = 'Bottle'
1566+
else:
1567+
always_item = location.item.name
1568+
if always_item in world.named_item_pool and world.settings.world_count == 1:
1569+
world.named_item_pool.remove(always_item)
15751570
if len(world.named_item_pool) > 0 and world.hint_dist_user['named_items_required']:
15761571
if hint_dist['named-item'][1] == 0:
15771572
raise Exception('User-provided item hints were requested, but copies per named-item hint is zero')

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '8.3.62'
1+
__version__ = '8.3.63'
22

33
# This is a supplemental version number for branches based off of main dev.
44
supplementary_version = 0

0 commit comments

Comments
 (0)