ItemLinks: prevent attempts at cross-game (#402)

This commit is contained in:
Fabian Dill 2022-04-03 19:09:05 +02:00 committed by GitHub
parent 215d5e9adf
commit ba3257f850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -212,6 +212,8 @@ class MultiWorld():
for player in self.player_ids:
for item_link in self.item_links[player].value:
if item_link["name"] in item_links:
if item_link["game"] != self.game[player]:
raise Exception(f"Cannot ItemLink across games. Link: {item_link['name']}")
item_links[item_link["name"]]["players"][player] = item_link["replacement_item"]
item_links[item_link["name"]]["item_pool"] &= set(item_link["item_pool"])
else: