mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-07 15:13:52 -08:00
Compare commits
1 Commits
0.6.2-rc3
...
NewSoupVi-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29ae9cd91e |
7
Fill.py
7
Fill.py
@@ -227,12 +227,15 @@ def remaining_fill(multiworld: MultiWorld,
|
||||
swapped_items: typing.Counter[typing.Tuple[int, str]] = Counter()
|
||||
total = min(len(itempool), len(locations))
|
||||
placed = 0
|
||||
|
||||
state = CollectionState(multiworld)
|
||||
|
||||
while locations and itempool:
|
||||
item_to_place = itempool.pop()
|
||||
spot_to_fill: typing.Optional[Location] = None
|
||||
|
||||
for i, location in enumerate(locations):
|
||||
if location.item_rule(item_to_place):
|
||||
if location.can_fill(state, item_to_place, check_access=False):
|
||||
# popping by index is faster than removing by content,
|
||||
spot_to_fill = locations.pop(i)
|
||||
# skipping a scan for the element
|
||||
@@ -253,7 +256,7 @@ def remaining_fill(multiworld: MultiWorld,
|
||||
|
||||
location.item = None
|
||||
placed_item.location = None
|
||||
if location.item_rule(item_to_place):
|
||||
if location.can_fill(state, item_to_place, check_access=False):
|
||||
# Add this item to the existing placement, and
|
||||
# add the old item to the back of the queue
|
||||
spot_to_fill = placements.pop(i)
|
||||
|
||||
Reference in New Issue
Block a user