Skip to content

Commit

Permalink
makes start inventory from pool warn and fixes the itempool to match …
Browse files Browse the repository at this point in the history
…when it can not find a matching item to remove
  • Loading branch information
qwint committed Apr 16, 2024
1 parent 5da3a40 commit 9b662b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,12 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
for player, remaining_items in depletion_pool.items():
remaining_items = {name: count for name, count in remaining_items.items() if count}
if remaining_items:
raise Exception(f"{multiworld.get_player_name(player)}"
logger.warning(f"{multiworld.get_player_name(player)}"
f" is trying to remove items from their pool that don't exist: {remaining_items}")
# find all filler we generated for the current player and remove until it matches
removables = [item for item in new_items if item.player == player]
for _ in range(len(remaining_items)):
new_items.remove(removables.pop())
assert len(multiworld.itempool) == len(new_items), "Item Pool amounts should not change."
multiworld.itempool[:] = new_items

Expand Down

0 comments on commit 9b662b0

Please sign in to comment.