Removing some permament negative effects of using copy_world
This commit is contained in:
13
Main.py
13
Main.py
@@ -398,7 +398,7 @@ def main(args, seed=None, fish=None):
|
||||
return world
|
||||
|
||||
|
||||
def copy_world(world):
|
||||
def copy_world(world, partial_copy=False):
|
||||
# ToDo: Not good yet
|
||||
ret = World(world.players, world.owShuffle, world.owCrossed, world.owMixed, world.shuffle, world.doorShuffle, world.logic, world.mode, world.swords,
|
||||
world.difficulty, world.difficulty_adjustments, world.timer, world.progressive, world.goal, world.algorithm,
|
||||
@@ -544,9 +544,10 @@ def copy_world(world):
|
||||
ret.dungeon_layouts = world.dungeon_layouts
|
||||
ret.key_logic = world.key_logic
|
||||
ret.dungeon_portals = world.dungeon_portals
|
||||
for player, portals in world.dungeon_portals.items():
|
||||
for portal in portals:
|
||||
connect_portal(portal, ret, player)
|
||||
if not partial_copy:
|
||||
for player, portals in world.dungeon_portals.items():
|
||||
for portal in portals:
|
||||
connect_portal(portal, ret, player)
|
||||
ret.sanc_portal = world.sanc_portal
|
||||
|
||||
from OverworldShuffle import categorize_world_regions
|
||||
@@ -554,6 +555,10 @@ def copy_world(world):
|
||||
categorize_world_regions(ret, player)
|
||||
set_rules(ret, player)
|
||||
|
||||
if partial_copy:
|
||||
# undo some of the things that unintentionally affect the original world object
|
||||
world.key_logic = {}
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user