Skip to content

Commit

Permalink
Core: fix start_inventory_from_pool only adding one filler per item name
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Sep 16, 2023
1 parent cff6c7c commit ce8f07b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
for player, items in depletion_pool.items():
player_world: AutoWorld.World = world.worlds[player]
for count in items.values():
new_items.append(player_world.create_filler())
for _ in range(count):
new_items.append(player_world.create_filler())
target: int = sum(sum(items.values()) for items in depletion_pool.values())
for i, item in enumerate(world.itempool):
if depletion_pool[item.player].get(item.name, 0):
Expand All @@ -179,6 +180,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
if remaining_items:
raise Exception(f"{world.get_player_name(player)}"
f" is trying to remove items from their pool that don't exist: {remaining_items}")
assert len(world.itempool) == len(new_items), "Item Pool amounts should not change."
world.itempool[:] = new_items

# temporary home for item links, should be moved out of Main
Expand Down

0 comments on commit ce8f07b

Please sign in to comment.