mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Move duplicate name item link check to verify.
This commit is contained in:
@@ -205,12 +205,7 @@ class MultiWorld():
|
|||||||
item_links = {}
|
item_links = {}
|
||||||
|
|
||||||
for player in self.player_ids:
|
for player in self.player_ids:
|
||||||
player_item_links = set()
|
|
||||||
for item_link in self.item_links[player].value:
|
for item_link in self.item_links[player].value:
|
||||||
if item_link["name"] in player_item_links:
|
|
||||||
raise Exception(f"Cannot name more than one item_link with the same name in the same yaml ({item_link['name']}) ({self.get_player_name(player)})")
|
|
||||||
else:
|
|
||||||
player_item_links.add(item_link["name"])
|
|
||||||
if item_link["name"] in item_links:
|
if item_link["name"] in item_links:
|
||||||
item_links[item_link["name"]]["players"][player] = item_link["replacement_item"]
|
item_links[item_link["name"]]["players"][player] = item_link["replacement_item"]
|
||||||
item_links[item_link["name"]]["item_pool"] &= set(item_link["item_pool"])
|
item_links[item_link["name"]]["item_pool"] &= set(item_link["item_pool"])
|
||||||
|
@@ -470,7 +470,11 @@ class ItemLinks(OptionList):
|
|||||||
|
|
||||||
def verify(self, world):
|
def verify(self, world):
|
||||||
super(ItemLinks, self).verify(world)
|
super(ItemLinks, self).verify(world)
|
||||||
|
existing_links = set()
|
||||||
for link in self.value:
|
for link in self.value:
|
||||||
|
if link["name"] in existing_links:
|
||||||
|
raise Exception(f"You cannot have more than one link named {link['name']}.")
|
||||||
|
existing_links.add(link["name"])
|
||||||
for item_name in link["item_pool"]:
|
for item_name in link["item_pool"]:
|
||||||
if item_name not in world.item_names and item_name not in world.item_name_groups:
|
if item_name not in world.item_names and item_name not in world.item_name_groups:
|
||||||
raise Exception(f"Item {item_name} from option {self} "
|
raise Exception(f"Item {item_name} from option {self} "
|
||||||
|
Reference in New Issue
Block a user