Skip to content

Commit

Permalink
Merge branch 'SC2-043-maintenance' into sc2-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Oct 5, 2023
2 parents 4c84cdd + 634dd82 commit c44d5a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion worlds/sc2/PoolFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,13 @@ def attempt_removal(item: Item) -> bool:

while len(inventory) + len(locked_items) > inventory_size:
if len(inventory) == 0:
raise Exception("Reduced item pool generation failed - not enough locations available to place items.")
# There are more items than locations and all of them are already locked due to YAML or logic.
# Random items from locked ones will go to starting items
self.multiworld.random.shuffle(locked_items)
while len(locked_items) > inventory_size:
item: Item = locked_items.pop()
self.multiworld.push_precollected(item)
break
# Select random item from removable items
item = self.multiworld.random.choice(inventory)
# Cascade removals to associated items
Expand Down
2 changes: 1 addition & 1 deletion worlds/sc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SC2World(World):
mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]] = {}
final_mission_id: int
victory_item: str
required_client_version = 0, 3, 6
required_client_version = 0, 4, 3

def __init__(self, multiworld: MultiWorld, player: int):
super(SC2World, self).__init__(multiworld, player)
Expand Down

0 comments on commit c44d5a2

Please sign in to comment.