diff --git a/Fill.py b/Fill.py index 4859ebc3..9acf7d45 100644 --- a/Fill.py +++ b/Fill.py @@ -661,9 +661,10 @@ def sell_potions(world, player): for potion in ['Green Potion', 'Blue Potion', 'Red Potion']: location = random.choice(filter_locations(ItemFactory(potion, player), locations, world, potion=True)) locations.remove(location) - p_item = next(item for item in world.itempool if item.name == potion and item.player == player) - world.push_item(location, p_item, collect=False) - world.itempool.remove(p_item) + p_item = next((item for item in world.itempool if item.name == potion and item.player == player), None) + if p_item: + world.push_item(location, p_item, collect=False) + world.itempool.remove(p_item) def sell_keys(world, player): diff --git a/Main.py b/Main.py index f731df8a..f6631ce5 100644 --- a/Main.py +++ b/Main.py @@ -250,6 +250,7 @@ def main(args, seed=None, fish=None): set_rules(world, player) district_item_pool_config(world) + fill_specific_items(world) for player in range(1, world.players + 1): if world.shopsanity[player]: sell_potions(world, player) @@ -262,7 +263,6 @@ def main(args, seed=None, fish=None): if args.print_custom_yaml: world.settings.record_item_pool(world) dungeon_tracking(world) - fill_specific_items(world) logger.info(world.fish.translate("cli", "cli", "placing.dungeon.prizes")) fill_prizes(world)