From 232bc2ffa994d78d954499da5045b9008490b9de Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Thu, 12 Sep 2024 17:19:31 -0500 Subject: [PATCH] Core: force item link items to progression and revert them to the "correct" classification in multidata --- BaseClasses.py | 5 +++-- Main.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index b40b872f0c8c..2580deac4947 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -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 @@ -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 @@ -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") diff --git a/Main.py b/Main.py index c931e22145a5..8bb7ecd2c283 100644 --- a/Main.py +++ b/Main.py @@ -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: