Core: Assert that all the items in the multiworld itempool are actually unplaced at the start of distribute_items_restrictive (#5109)

* Assert at the beginning of distribute items restrictive that no items in the itempool already have locations associated with them

* actual message

* placement

* oops

* Update Fill.py
This commit is contained in:
NewSoupVi
2025-07-15 20:32:22 +02:00
committed by GitHub
parent c879307b8e
commit f967444ac2

View File

@@ -450,6 +450,12 @@ def distribute_early_items(multiworld: MultiWorld,
def distribute_items_restrictive(multiworld: MultiWorld,
panic_method: typing.Literal["swap", "raise", "start_inventory"] = "swap") -> None:
assert all(item.location is None for item in multiworld.itempool), (
"At the start of distribute_items_restrictive, "
"there are items in the multiworld itempool that are already placed on locations:\n"
f"{[(item.location, item) for item in multiworld.itempool if item.location is not None]}"
)
fill_locations = sorted(multiworld.get_unfilled_locations())
multiworld.random.shuffle(fill_locations)
# get items to distribute