From 9b662b02e3de31b72397365c6b58a65cea9284f9 Mon Sep 17 00:00:00 2001 From: qwint Date: Mon, 15 Apr 2024 20:43:35 -0500 Subject: [PATCH] makes start inventory from pool warn and fixes the itempool to match when it can not find a matching item to remove --- Main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Main.py b/Main.py index f1d2f63692d6..e960175df5b3 100644 --- a/Main.py +++ b/Main.py @@ -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