def connect_two_way(world, entrancename, exitname, player):
    entrance = world.get_entrance(entrancename, player)
    ext = world.get_entrance(exitname, player)
    if (entrance.connected_region is not None):
        entrance.connected_region.entrances.remove(entrance)
    if (ext.connected_region is not None):
        ext.connected_region.entrances.remove(ext)
    entrance.connect(ext.parent_region)
    ext.connect(entrance.parent_region)
    if entrance.parent_region.dungeon:
        ext.parent_region.dungeon = entrance.parent_region.dungeon
    x = world.check_for_door(entrancename, player)
    y = world.check_for_door(exitname, player)
    if (x is not None):
        x.dest = y
    if (y is not None):
        y.dest = x
def connect_two_way(world, entrancename, exitname, player):
    entrance = world.get_entrance(entrancename, player)
    ext = world.get_entrance(exitname, player)
    if (entrance.connected_region is not None):
        entrance.connected_region.entrances.remove(entrance)
    if (ext.connected_region is not None):
        ext.connected_region.entrances.remove(ext)
    entrance.connect(ext.parent_region)
    ext.connect(entrance.parent_region)
    if entrance.parent_region.dungeon:
        ext.parent_region.dungeon = entrance.parent_region.dungeon
    x = world.check_for_door(entrancename, player)
    y = world.check_for_door(exitname, player)
    if (x is not None):
        x.dest = y
    if (y is not None):
        y.dest = x