From 0dbae8e21ec46b12ac46b81a88c3f65dbacb9e37 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 15 Mar 2026 16:32:54 -0500 Subject: [PATCH] Fixed bug/oversight with vanilla_fill and prize_shuffle --- Fill.py | 17 +++++++++++++++-- source/item/FillUtil.py | 3 --- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Fill.py b/Fill.py index 83d7a737..04ab18ee 100644 --- a/Fill.py +++ b/Fill.py @@ -111,7 +111,7 @@ def fill_dungeons_restrictive(world, shuffled_locations): for attempt in range(15): try: for player in range(1, world.players + 1): - if world.prizeshuffle[player] == 'nearby': + if world.prizeshuffle[player] == 'nearby' and world.algorithm != 'vanilla_fill': dungeon_pool = [] for dungeon in world.dungeons: from Dungeons import dungeon_table @@ -143,6 +143,14 @@ def fill_dungeons_restrictive(world, shuffled_locations): else: raise FillError(f'Unable to place dungeon prizes: {", ".join(list(map(lambda d: d.name, prizes)))}') + if world.algorithm == 'vanilla_fill': + for prize in prizes_copy: + if prize.is_near_dungeon_item(world): + if prize.location and prize.location.parent_region.dungeon: + dungeon = prize.location.parent_region.dungeon + dungeon.prize = prize + prize.dungeon_object = dungeon + random.shuffle(shuffled_locations) fill(all_state_base, others, shuffled_locations) @@ -234,7 +242,8 @@ def verify_spot_to_fill(location, item_to_place, max_exp_state, single_player_pl test_state.sweep_for_events() if location.can_fill(test_state, item_to_place, perform_access_check): if valid_key_placement(item_to_place, location, key_pool, test_state, world): - if (item_to_place.prize and world.prizeshuffle[item_to_place.player] == 'none') \ + if (item_to_place.prize and (world.prizeshuffle[item_to_place.player] == 'none' \ + or (world.algorithm == 'vanilla_fill' and item_to_place.is_near_dungeon_item(world)))) \ or valid_dungeon_placement(item_to_place, location, world): return location if item_to_place.smallkey or item_to_place.bigkey or item_to_place.prize: @@ -330,6 +339,10 @@ def track_dungeon_items(item, location, world): if item.prize: location.parent_region.dungeon.prize = item item.dungeon_object = location.parent_region.dungeon + elif world.algorithm == 'vanilla_fill' and item.prize and location.parent_region.dungeon: + dungeon = location.parent_region.dungeon + dungeon.prize = item + item.dungeon_object = dungeon def is_dungeon_item(item, world): diff --git a/source/item/FillUtil.py b/source/item/FillUtil.py index 25bebbcd..6f1016fa 100644 --- a/source/item/FillUtil.py +++ b/source/item/FillUtil.py @@ -120,9 +120,6 @@ def create_item_pool_config(world): LocationGroup('bkgt').locs(mode_grouping['GT Trash'])] for loc_name in mode_grouping['Big Chests'] + mode_grouping['Heart Containers']: config.reserved_locations[player].add(loc_name) - if world.prizeshuffle[player] != 'none': - for loc_name in mode_grouping['Prizes']: - config.reserved_locations[player].add(loc_name) elif world.algorithm == 'major_only': config.location_groups = [ LocationGroup('MajorItems'),