From f3b490b10aeac32ba859b929ff13ff882d818a17 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 1 Nov 2025 14:32:04 -0400 Subject: Store stable IDs in multiworld state --- apworld/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apworld/__init__.py') diff --git a/apworld/__init__.py b/apworld/__init__.py index f5774c6..3d2f075 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py @@ -77,7 +77,10 @@ class Lingo2World(World): if self.options.shuffle_worldports: if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough: slot_value = self.multiworld.re_gen_passthrough["Lingo 2"]["port_pairings"] - self.port_pairings = {int(fp): int(tp) for fp, tp in slot_value.items()} + self.port_pairings = { + self.static_logic.port_id_by_ap_id[int(fp)]: self.static_logic.port_id_by_ap_id[int(tp)] + for fp, tp in slot_value.items() + } connect_ports_from_ut(self.port_pairings, self) else: @@ -152,7 +155,11 @@ class Lingo2World(World): } if self.options.shuffle_worldports: - slot_data["port_pairings"] = self.port_pairings + def get_port_ap_id(port_id): + return self.static_logic.objects.ports[port_id].ap_id + + slot_data["port_pairings"] = {get_port_ap_id(from_id): get_port_ap_id(to_id) + for from_id, to_id in self.port_pairings.items()} return slot_data -- cgit 1.4.1