Prevent duplicate entrance entries
This commit is contained in:
@@ -1843,7 +1843,8 @@ class Entrance(object):
|
|||||||
self.target = target
|
self.target = target
|
||||||
self.addresses = addresses
|
self.addresses = addresses
|
||||||
self.vanilla = vanilla
|
self.vanilla = vanilla
|
||||||
region.entrances.append(self)
|
if self not in region.entrances:
|
||||||
|
region.entrances.append(self)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.__unicode__())
|
return str(self.__unicode__())
|
||||||
|
|||||||
4
Main.py
4
Main.py
@@ -863,7 +863,9 @@ def copy_world_premature(world, player):
|
|||||||
for location in copied_region.locations:
|
for location in copied_region.locations:
|
||||||
location.parent_region = copied_region
|
location.parent_region = copied_region
|
||||||
for entrance in region.entrances:
|
for entrance in region.entrances:
|
||||||
copied_region.entrances.append(ret.get_entrance(entrance.name, entrance.player))
|
ent = ret.get_entrance(entrance.name, entrance.player)
|
||||||
|
if ent not in copied_region.entrances:
|
||||||
|
copied_region.entrances.append(ent)
|
||||||
for exit in region.exits:
|
for exit in region.exits:
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user