diff --git a/EntranceShuffle.py b/EntranceShuffle.py index a1e15991..020e95a7 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -1106,7 +1106,8 @@ def connect_random(world, exitlist, targetlist, player, two_way=False): def connect_mandatory_exits(world, entrances, caves, must_be_exits, player): # Keeps track of entrances that cannot be used to access each exit / cave - if world.mode[player] == 'inverted': + inverted = world.mode[player] == 'inverted' + if inverted: invalid_connections = Inverted_Must_Exit_Invalid_Connections.copy() else: invalid_connections = Must_Exit_Invalid_Connections.copy() @@ -1114,7 +1115,7 @@ def connect_mandatory_exits(world, entrances, caves, must_be_exits, player): if world.logic[player] in ['owglitches', 'hybridglitches', 'nologic']: import OverworldGlitchRules - for entrance in OverworldGlitchRules.get_non_mandatory_exits(world.mode[player] == 'inverted'): + for entrance in OverworldGlitchRules.inverted_non_mandatory_exits if inverted else OverworldGlitchRules.open_non_mandatory_exits: invalid_connections[entrance] = set() if entrance in must_be_exits: must_be_exits.remove(entrance) @@ -1125,7 +1126,7 @@ def connect_mandatory_exits(world, entrances, caves, must_be_exits, player): random.shuffle(caves) # Handle inverted Aga Tower - if it depends on connections, then so does Hyrule Castle Ledge - if world.mode[player] == 'inverted': + if inverted: for entrance in invalid_connections: if world.get_entrance(entrance, player).connected_region == world.get_region('Agahnims Tower Portal', player): for exit in invalid_connections[entrance]: diff --git a/source/overworld/EntranceShuffle2.py b/source/overworld/EntranceShuffle2.py index 9847e472..1d36e43c 100644 --- a/source/overworld/EntranceShuffle2.py +++ b/source/overworld/EntranceShuffle2.py @@ -959,7 +959,7 @@ def do_mandatory_connections(avail, entrances, cave_options, must_exit): if avail.world.logic[avail.player] in ['owglitches', 'hybridglitches', 'nologic']: import OverworldGlitchRules - for entrance in OverworldGlitchRules.get_non_mandatory_exits(avail.inverted): + for entrance in OverworldGlitchRules.inverted_non_mandatory_exits if avail.inverted else OverworldGlitchRules.open_non_mandatory_exits: invalid_connections[entrance] = set() if entrance in must_exit: must_exit.remove(entrance)