From 6970c5ce9748ee0fe21f8f0da0aea7864fcc51e0 Mon Sep 17 00:00:00 2001 From: Daniel Grace Date: Sun, 19 Jun 2022 19:39:14 -0700 Subject: [PATCH] HK: Bugfix shop requirements to be >= rather than >. This was causing off-by-one errors, which were problematic if e.g. a Grubfather slot wanted all 46 grubs. --- worlds/hk/Rules.py | 2 +- worlds/hk/templates/RulesTemplate.pyt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worlds/hk/Rules.py b/worlds/hk/Rules.py index a6d404f0..fbacc83a 100644 --- a/worlds/hk/Rules.py +++ b/worlds/hk/Rules.py @@ -27,7 +27,7 @@ def set_shop_prices(hk_world): for shop, unit in hk_world.shops.items(): for i in range(1, 1 + hk_world.created_multi_locations[shop]): loc = hk_world.world.get_location(f"{shop}_{i}", hk_world.player) - add_rule(loc, lambda state, unit=units[unit], cost=loc.cost: state.count(unit, player) > cost) + add_rule(loc, lambda state, unit=units[unit], cost=loc.cost: state.count(unit, player) >= cost) def set_rules(hk_world): diff --git a/worlds/hk/templates/RulesTemplate.pyt b/worlds/hk/templates/RulesTemplate.pyt index 27c8a6b8..40071bbf 100644 --- a/worlds/hk/templates/RulesTemplate.pyt +++ b/worlds/hk/templates/RulesTemplate.pyt @@ -25,7 +25,7 @@ def set_shop_prices(hk_world): for shop, unit in hk_world.shops.items(): for i in range(1, 1 + hk_world.created_multi_locations[shop]): loc = hk_world.world.get_location(f"{shop}_{i}", hk_world.player) - add_rule(loc, lambda state, unit=units[unit], cost=loc.cost: state.count(unit, player) > cost) + add_rule(loc, lambda state, unit=units[unit], cost=loc.cost: state.count(unit, player) >= cost) def set_rules(hk_world):