From 2ff611167a4415f2d06b6904434e814cf6595174 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 14 Jun 2025 12:21:25 +0200 Subject: [PATCH] =?UTF-8?q?ALTTP:=20Fix=20take=5Fany=20leaving=20a=20place?= =?UTF-8?q?d=20item=20in=20the=20multiworld=20itempool=C2=A0#5108?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worlds/alttp/ItemPool.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/worlds/alttp/ItemPool.py b/worlds/alttp/ItemPool.py index 57ad01b9..9f1a58e5 100644 --- a/worlds/alttp/ItemPool.py +++ b/worlds/alttp/ItemPool.py @@ -548,10 +548,12 @@ def set_up_take_anys(multiworld, world, player): old_man_take_any.shop = TakeAny(old_man_take_any, 0x0112, 0xE2, True, True, total_shop_slots) multiworld.shops.append(old_man_take_any.shop) - swords = [item for item in multiworld.itempool if item.player == player and item.type == 'Sword'] - if swords: - sword = multiworld.random.choice(swords) - multiworld.itempool.remove(sword) + sword_indices = [ + index for index, item in enumerate(multiworld.itempool) if item.player == player and item.type == 'Sword' + ] + if sword_indices: + sword_index = multiworld.random.choice(sword_indices) + sword = multiworld.itempool.pop(sword_index) multiworld.itempool.append(item_factory('Rupees (20)', world)) old_man_take_any.shop.add_inventory(0, sword.name, 0, 0) loc_name = "Old Man Sword Cave"