mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
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:
6
Fill.py
6
Fill.py
@@ -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
|
||||
|
Reference in New Issue
Block a user