diff --git a/worlds/sc2/pool_filter.py b/worlds/sc2/pool_filter.py index 476fb3057393..28c7871bd8f7 100644 --- a/worlds/sc2/pool_filter.py +++ b/worlds/sc2/pool_filter.py @@ -425,15 +425,14 @@ def attempt_removal(item: Item) -> bool: locked_items = [item for item in locked_items if item.name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK] if item_names.MEDIVAC not in logical_inventory_set: # Don't allow L2 Siege Tank Transport Hook without Medivac - inventory_transport_hooks = [item for item in (inventory + locked_items) if item.name == item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK] - if len(inventory_transport_hooks) > 1: - if inventory_transport_hooks[0] in inventory: - inventory.remove(inventory_transport_hooks[0]) - elif inventory_transport_hooks[1] in inventory: + inventory_transport_hooks = [item for item in inventory if item.name == item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK] + locked_transport_hooks = [item for item in locked_items if item.name == item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK] + if len(inventory_transport_hooks) + len(locked_transport_hooks) > 1: + if len(inventory_transport_hooks) > 1: inventory.remove(inventory_transport_hooks[0]) else: - locked_items.remove(inventory_transport_hooks[0]) - if len(inventory_transport_hooks) > 0: + locked_items.remove(locked_transport_hooks[0]) + if len(inventory_transport_hooks) + len(locked_transport_hooks) > 0: # Transport Hook is in inventory, remove from unused_items unused_items = [item_name for item_name in unused_items if item_name != item_names.SIEGE_TANK_PROGRESSIVE_TRANSPORT_HOOK] else: @@ -445,7 +444,7 @@ def attempt_removal(item: Item) -> bool: # No orbital Command Spells inventory = [item for item in inventory if item.name != item_names.PLANETARY_FORTRESS_ORBITAL_MODULE] unused_items = [item_name for item_name in unused_items if item_name !=item_names.PLANETARY_FORTRESS_ORBITAL_MODULE] - locked_items = [item for item in inventory if item.name != item_names.PLANETARY_FORTRESS_ORBITAL_MODULE] + locked_items = [item for item in locked_items if item.name != item_names.PLANETARY_FORTRESS_ORBITAL_MODULE] # HotS # Baneling without sources => remove Baneling and upgrades