about summary refs log tree commit diff stats
path: root/apworld/__init__.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-11-01 14:32:04 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-11-01 14:32:04 -0400
commitf3b490b10aeac32ba859b929ff13ff882d818a17 (patch)
tree1fbcc27fc7fed2646ea86fede3f28b26a58a0297 /apworld/__init__.py
parent21013ec0d1e3953276f11bd8cce12f33d46a33ec (diff)
downloadlingo2-archipelago-f3b490b10aeac32ba859b929ff13ff882d818a17.tar.gz
lingo2-archipelago-f3b490b10aeac32ba859b929ff13ff882d818a17.tar.bz2
lingo2-archipelago-f3b490b10aeac32ba859b929ff13ff882d818a17.zip
Store stable IDs in multiworld state
Diffstat (limited to 'apworld/__init__.py')
-rw-r--r--apworld/__init__.py11
1 files changed, 9 insertions, 2 deletions
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):
77 if self.options.shuffle_worldports: 77 if self.options.shuffle_worldports:
78 if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough: 78 if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough:
79 slot_value = self.multiworld.re_gen_passthrough["Lingo 2"]["port_pairings"] 79 slot_value = self.multiworld.re_gen_passthrough["Lingo 2"]["port_pairings"]
80 self.port_pairings = {int(fp): int(tp) for fp, tp in slot_value.items()} 80 self.port_pairings = {
81 self.static_logic.port_id_by_ap_id[int(fp)]: self.static_logic.port_id_by_ap_id[int(tp)]
82 for fp, tp in slot_value.items()
83 }
81 84
82 connect_ports_from_ut(self.port_pairings, self) 85 connect_ports_from_ut(self.port_pairings, self)
83 else: 86 else:
@@ -152,7 +155,11 @@ class Lingo2World(World):
152 } 155 }
153 156
154 if self.options.shuffle_worldports: 157 if self.options.shuffle_worldports:
155 slot_data["port_pairings"] = self.port_pairings 158 def get_port_ap_id(port_id):
159 return self.static_logic.objects.ports[port_id].ap_id
160
161 slot_data["port_pairings"] = {get_port_ap_id(from_id): get_port_ap_id(to_id)
162 for from_id, to_id in self.port_pairings.items()}
156 163
157 return slot_data 164 return slot_data
158 165