From 9c80a7c4ec62b24c30fad8b28c386390b8c686d2 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 29 Oct 2023 19:53:57 +0100 Subject: [PATCH] HK: skip for loop (#2390) --- worlds/hk/Rules.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/worlds/hk/Rules.py b/worlds/hk/Rules.py index 4fe4160b..2dc512ec 100644 --- a/worlds/hk/Rules.py +++ b/worlds/hk/Rules.py @@ -1,5 +1,4 @@ from ..generic.Rules import set_rule, add_rule -from BaseClasses import MultiWorld from ..AutoWorld import World from .GeneratedRules import set_generated_rules from typing import NamedTuple @@ -39,14 +38,12 @@ def hk_set_rule(hk_world: World, location: str, rule): def set_rules(hk_world: World): player = hk_world.player - world = hk_world.multiworld set_generated_rules(hk_world, hk_set_rule) # Shop costs - for region in world.get_regions(player): - for location in region.locations: - if location.costs: - for term, amount in location.costs.items(): - if term == "GEO": # No geo logic! - continue - add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount) + for location in hk_world.multiworld.get_locations(player): + if location.costs: + for term, amount in location.costs.items(): + if term == "GEO": # No geo logic! + continue + add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount)