Move duplicate name item link check to verify.

This commit is contained in:
CaitSith2
2022-02-23 15:17:24 -08:00
parent f167e11905
commit 6e0165986f
2 changed files with 4 additions and 5 deletions

View File

@@ -470,7 +470,11 @@ class ItemLinks(OptionList):
def verify(self, world):
super(ItemLinks, self).verify(world)
existing_links = set()
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"]:
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} "