Fixed duplicate exit issue in copy_world
This commit is contained in:
10
Main.py
10
Main.py
@@ -635,7 +635,10 @@ def copy_world(world):
|
|||||||
if exit.connected_region:
|
if exit.connected_region:
|
||||||
dest_region = ret.get_region(exit.connected_region.name, region.player)
|
dest_region = ret.get_region(exit.connected_region.name, region.player)
|
||||||
src_exit = ret.get_entrance(exit.name, exit.player)
|
src_exit = ret.get_entrance(exit.name, exit.player)
|
||||||
if exit.name not in [e.name for e in dest_region.entrances]:
|
if exit.name not in [e.name for e in dest_region.entrances if e.connected_region is not None]:
|
||||||
|
if exit.name in [e.name for e in dest_region.entrances]:
|
||||||
|
src_exit.connected_region = dest_region
|
||||||
|
else:
|
||||||
src_exit.connect(dest_region)
|
src_exit.connect(dest_region)
|
||||||
|
|
||||||
# fill locations
|
# fill locations
|
||||||
@@ -799,7 +802,10 @@ def copy_world_premature(world, player):
|
|||||||
if exit.connected_region:
|
if exit.connected_region:
|
||||||
dest_region = ret.get_region(exit.connected_region.name, region.player)
|
dest_region = ret.get_region(exit.connected_region.name, region.player)
|
||||||
src_exit = ret.get_entrance(exit.name, exit.player)
|
src_exit = ret.get_entrance(exit.name, exit.player)
|
||||||
if exit.name not in [e.name for e in dest_region.entrances]:
|
if exit.name not in [e.name for e in dest_region.entrances if e.connected_region is not None]:
|
||||||
|
if exit.name in [e.name for e in dest_region.entrances]:
|
||||||
|
src_exit.connected_region = dest_region
|
||||||
|
else:
|
||||||
src_exit.connect(dest_region)
|
src_exit.connect(dest_region)
|
||||||
|
|
||||||
from OverworldShuffle import categorize_world_regions
|
from OverworldShuffle import categorize_world_regions
|
||||||
|
|||||||
Reference in New Issue
Block a user