From 12eba33dbf91c7069983440ae3e57c30d386f0fd Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Thu, 15 Jul 2021 16:52:30 -0500 Subject: [PATCH] separate fill step for nonadvancement nonexcluded items --- Fill.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Fill.py b/Fill.py index 3def9f917b..9044733d49 100644 --- a/Fill.py +++ b/Fill.py @@ -78,12 +78,15 @@ def distribute_items_restrictive(world: MultiWorld, gftower_trash=False, fill_lo # get items to distribute world.random.shuffle(world.itempool) progitempool = [] + nonexcludeditempool = [] localrestitempool = {player: [] for player in range(1, world.players + 1)} restitempool = [] for item in world.itempool: - if item.advancement or not item.can_exclude: + if item.advancement: progitempool.append(item) + elif not item.can_exclude: # must place items that can't go into excluded locations with some logic + nonexcludeditempool.append(item) elif item.name in world.local_items[item.player]: localrestitempool[item.player].append(item) else: @@ -137,6 +140,10 @@ def distribute_items_restrictive(world: MultiWorld, gftower_trash=False, fill_lo world.random.shuffle(fill_locations) fill_restrictive(world, world.state, fill_locations, progitempool) + if nonexcludeditempool: + world.random.shuffle(fill_locations) + fill_restrictive(world, world.state, fill_locations, nonexcludeditempool) + if any(localrestitempool.values()): # we need to make sure some fills are limited to certain worlds local_locations = {player: [] for player in world.player_ids} for location in fill_locations: