Sort before distribute to preserve seed integrity

This commit is contained in:
Brad Humphrey
2022-01-27 09:25:42 -07:00
committed by Fabian Dill
parent 695e87689c
commit 65a92746d1
2 changed files with 39 additions and 31 deletions

View File

@@ -104,18 +104,19 @@ def fill_restrictive(world: MultiWorld, base_state: CollectionState, locations,
def distribute_items_restrictive(world: MultiWorld):
fill_locations = world.get_unfilled_locations()
fill_locations = sorted(world.get_unfilled_locations())
world.random.shuffle(fill_locations)
# get items to distribute
world.random.shuffle(world.itempool)
itempool = sorted(world.itempool)
world.random.shuffle(itempool)
progitempool = []
nonexcludeditempool = []
localrestitempool = {player: [] for player in range(1, world.players + 1)}
nonlocalrestitempool = []
restitempool = []
for item in world.itempool:
for item in itempool:
if item.advancement:
progitempool.append(item)
elif item.never_exclude: # this only gets nonprogression items which should not appear in excluded locations