From 6f20c8a2628e617c29a10760ff908ed40f5def8c Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Fri, 9 Aug 2024 21:33:29 -0400 Subject: [PATCH] Fix weird edge case that is technically user error --- worlds/tunic/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/worlds/tunic/__init__.py b/worlds/tunic/__init__.py index 8280806a7f..5e8cd87975 100644 --- a/worlds/tunic/__init__.py +++ b/worlds/tunic/__init__.py @@ -92,12 +92,17 @@ class TunicWorld(World): for index, cxn in enumerate(self.options.plando_connections): # flip any that are pointing to exit to point to entrance so that I don't have to deal with it if self.options.decoupled and cxn.direction == "exit": - replacement = PlandoConnection(entrance=cxn.exit, exit=cxn.entrance, direction="entrance", percentage=cxn.percentage) + replacement = PlandoConnection(cxn.exit, cxn.entrance, "entrance", cxn.percentage) self.options.plando_connections.value.remove(cxn) self.options.plando_connections.value.insert(index, replacement) # if decoupled is off, just convert these to both if not self.options.decoupled and cxn.direction != "both": - replacement = PlandoConnection(entrance=cxn.entrance, exit=cxn.exit, direction="both", percentage=cxn.percentage) + replacement = PlandoConnection(cxn.entrance, cxn.exit, "both", cxn.percentage) + self.options.plando_connections.value.remove(cxn) + self.options.plando_connections.value.insert(index, replacement) + # if decoupled is on and you plando'd an entrance to itself but left the direction as both + if self.options.decoupled and cxn.direction == "both" and cxn.entrance == cxn.exit: + replacement = PlandoConnection(cxn.entrance, cxn.exit, "entrance") self.options.plando_connections.value.remove(cxn) self.options.plando_connections.value.insert(index, replacement)