Skip to content

Commit 33fd9de

Browse files
qwintExempt-Medic
andauthored
Core: Add Retry to Priority Fill (#4477)
* adds a retry to priority fill in case the one item per player optimization would cause the priority fill to fail to find valid placements * Update Fill.py Co-authored-by: Exempt-Medic <[email protected]> --------- Co-authored-by: Exempt-Medic <[email protected]>
1 parent a126dee commit 33fd9de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Fill.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,13 @@ def mark_for_locking(location: Location):
502502
# "priority fill"
503503
fill_restrictive(multiworld, multiworld.state, prioritylocations, progitempool,
504504
single_player_placement=single_player, swap=False, on_place=mark_for_locking,
505-
name="Priority", one_item_per_player=False)
505+
name="Priority", one_item_per_player=True, allow_partial=True)
506+
507+
if prioritylocations:
508+
# retry with one_item_per_player off because some priority fills can fail to fill with that optimization
509+
fill_restrictive(multiworld, multiworld.state, prioritylocations, progitempool,
510+
single_player_placement=single_player, swap=False, on_place=mark_for_locking,
511+
name="Priority Retry", one_item_per_player=False)
506512
accessibility_corrections(multiworld, multiworld.state, prioritylocations, progitempool)
507513
defaultlocations = prioritylocations + defaultlocations
508514

0 commit comments

Comments
 (0)