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.
This commit is contained in:
Daniel Grace 2022-06-19 19:39:14 -07:00 committed by Fabian Dill
parent 10b3803a7f
commit 6970c5ce97
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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):