From 774581b7ba8959b55f5e3c9e445c3b82b07c75b6 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Mon, 14 Nov 2022 18:57:47 -0600 Subject: [PATCH] HK: fix crash if shop locations are at max and extra shop slots is nonzero --- worlds/hk/__init__.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/worlds/hk/__init__.py b/worlds/hk/__init__.py index 6a1000b6..a635bb5c 100644 --- a/worlds/hk/__init__.py +++ b/worlds/hk/__init__.py @@ -318,14 +318,15 @@ class HKWorld(World): if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there shops.remove('Egg_Shop') - for _ in range(additional_shop_items): - shop = self.multiworld.random.choice(shops) - loc = self.create_location(shop) - unfilled_locations += 1 - if len(self.created_multi_locations[shop]) >= 16: - shops.remove(shop) - if not shops: - break + if shops: + for _ in range(additional_shop_items): + shop = self.multiworld.random.choice(shops) + loc = self.create_location(shop) + unfilled_locations += 1 + if len(self.created_multi_locations[shop]) >= 16: + shops.remove(shop) + if not shops: + break # Create filler items, if needed if item_count < unfilled_locations: