Set location's parent_region when moving it.
Fix copy_world to handle moved locations
This commit is contained in:
3
Main.py
3
Main.py
@@ -421,6 +421,9 @@ def copy_world(world):
|
||||
copied_region = ret.get_region(region.name, region.player)
|
||||
copied_region.is_light_world = region.is_light_world
|
||||
copied_region.is_dark_world = region.is_dark_world
|
||||
copied_region.locations = [copy.copy(location) for location in region.locations]
|
||||
for location in copied_region.locations:
|
||||
location.parent_region = copied_region
|
||||
for entrance in region.entrances:
|
||||
ret.get_entrance(entrance.name, entrance.player).connect(copied_region)
|
||||
|
||||
|
||||
@@ -314,6 +314,7 @@ def shuffle_pots(world, player):
|
||||
key = next(location for location in world.get_region(old_pot.room, player).locations if location.name in key_drop_data)
|
||||
world.get_region(old_pot.room, player).locations.remove(key)
|
||||
world.get_region(new_pot.room, player).locations.append(key)
|
||||
key.parent_region = world.get_region(new_pot.room, player)
|
||||
elif new_pot.item == PotItem.Switch and (new_pot.flags & PotFlags.SwitchLogicChange):
|
||||
if new_pot.room == 'PoD Basement Ledge':
|
||||
basement = world.get_region(old_pot.room, player)
|
||||
|
||||
Reference in New Issue
Block a user