Add test for minimal accessibility

This commit is contained in:
Brad Humphrey
2021-12-28 11:57:48 -07:00
committed by Fabian Dill
parent e5fedb90a6
commit 18d262c1ae
2 changed files with 68 additions and 25 deletions

View File

@@ -62,7 +62,7 @@ def fill_restrictive(world: MultiWorld, base_state: CollectionState, locations,
# try swaping this item with previously placed items
for(i, location) in enumerate(placements):
placed_item = location.item
# Unplaceable items can sometimes be swapped infinitely. Limit the
# Unplaceable items can sometimes be swapped infinitely. Limit the
# number of times we will swap an individual item to prevent this
if swapped_items[placed_item.player, placed_item.name] > 0:
continue
@@ -74,8 +74,10 @@ def fill_restrictive(world: MultiWorld, base_state: CollectionState, locations,
# Add this item to the exisiting placement, and
# add the old item to the back of the queue
spot_to_fill = placements.pop(i)
swapped_items[placed_item.player, placed_item.name] += 1
reachable_items[placed_item.player].appendleft(placed_item)
swapped_items[placed_item.player,
placed_item.name] += 1
reachable_items[placed_item.player].appendleft(
placed_item)
itempool.append(placed_item)
break
else: