Skip to content

Commit

Permalink
Core: force item link items to progression and revert them to the "co…
Browse files Browse the repository at this point in the history
…rrect" classification in multidata
  • Loading branch information
alwaysintreble committed Sep 12, 2024
1 parent 7621889 commit 232bc2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class MultiWorld():
plando_connections: List
worlds: Dict[int, "AutoWorld.World"]
groups: Dict[int, Group]
group_classifications: Dict[str, int]
regions: RegionManager
itempool: List[Item]
is_race: bool = False
Expand Down Expand Up @@ -327,7 +328,7 @@ def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
del (counters[player][item])
return counters, classifications

common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
common_item_count, self.group_classifications = find_common_pool(group["players"], group["item_pool"])
if not common_item_count:
continue

Expand All @@ -336,7 +337,7 @@ def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
for _ in range(item_count):
new_item = group["world"].create_item(item_name)
# mangle together all original classification bits
new_item.classification |= classifications[item_name]
new_item.classification = ItemClassification.progression
new_itempool.append(new_item)

region = Region("Menu", group_id, self, "ItemLink")
Expand Down
2 changes: 2 additions & 0 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def precollect_hint(location):
assert location.address not in locations_data[location.player], (
f"Locations with duplicate address. {location} and "
f"{locations_data[location.player][location.address]}")
if location.item.player in multiworld.groups:
location.item.code = multiworld.group_classifications[location.item.name]
locations_data[location.player][location.address] = \
location.item.code, location.item.player, location.item.flags
if location.name in multiworld.worlds[location.player].options.start_location_hints:
Expand Down

0 comments on commit 232bc2f

Please sign in to comment.