Fix bug where you can force non-local triforce pieces on a local triforce hunt.

This commit is contained in:
CaitSith2 2021-01-05 09:56:20 -08:00
parent a6d53aafb0
commit 2891d575f0
2 changed files with 5 additions and 2 deletions

View File

@ -119,6 +119,11 @@ def main(args, seed=None):
item.strip() in item_table} item.strip() in item_table}
world.non_local_items[player] = {item.strip() for item in args.non_local_items[player].split(',') if world.non_local_items[player] = {item.strip() for item in args.non_local_items[player].split(',') if
item.strip() in item_table} item.strip() in item_table}
# enforce pre-defined local items.
if world.goal[player] in ["localtriforcehunt", "localganontriforcehunt"]:
world.local_items[player].add('Triforce Piece')
# items can't be both local and non-local, prefer local # items can't be both local and non-local, prefer local
world.non_local_items[player] -= world.local_items[player] world.non_local_items[player] -= world.local_items[player]

View File

@ -173,8 +173,6 @@ def item_name(state, location, player):
def locality_rules(world, player): def locality_rules(world, player):
if world.goal[player] in ["localtriforcehunt", "localganontriforcehunt"]:
world.local_items[player].add('Triforce Piece')
if world.local_items[player]: if world.local_items[player]:
for location in world.get_locations(): for location in world.get_locations():
if location.player != player: if location.player != player: