HK: fix crash if shop locations are at max and extra shop slots is nonzero

This commit is contained in:
espeon65536 2022-11-14 18:57:47 -06:00 committed by Fabian Dill
parent 95f90851ac
commit 774581b7ba
1 changed files with 9 additions and 8 deletions

View File

@ -318,14 +318,15 @@ class HKWorld(World):
if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there
shops.remove('Egg_Shop') shops.remove('Egg_Shop')
for _ in range(additional_shop_items): if shops:
shop = self.multiworld.random.choice(shops) for _ in range(additional_shop_items):
loc = self.create_location(shop) shop = self.multiworld.random.choice(shops)
unfilled_locations += 1 loc = self.create_location(shop)
if len(self.created_multi_locations[shop]) >= 16: unfilled_locations += 1
shops.remove(shop) if len(self.created_multi_locations[shop]) >= 16:
if not shops: shops.remove(shop)
break if not shops:
break
# Create filler items, if needed # Create filler items, if needed
if item_count < unfilled_locations: if item_count < unfilled_locations: