From 5dae0ddd365f1d631c282a249057095cec6d2200 Mon Sep 17 00:00:00 2001 From: Ziktofel Date: Sun, 9 Jun 2024 23:20:30 +0200 Subject: [PATCH] More bugfixes --- worlds/sc2/pool_filter.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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