Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,7 @@ def __init__(self, player, name='', address=None, crystal=False, hint_text=None,
self.staleness_count = 0
self.locked = False
self.real = not crystal
self.always_allow = lambda item, state: False
self.always_allow = None
self.access_rule = lambda state: True
self.verbose_rule = None
self.item_rule = lambda item: True
Expand All @@ -2291,7 +2291,7 @@ def __init__(self, player, name='', address=None, crystal=False, hint_text=None,
def can_fill(self, state, item, check_access=True):
if not self.valid_multiworld(state, item):
return False
return self.always_allow(state, item) or (self.parent_region.can_fill(item) and self.item_rule(item) and (not check_access or self.can_reach(state)))
return (self.always_allow and self.always_allow(state, item)) or (self.parent_region.can_fill(item) and self.item_rule(item) and (not check_access or self.can_reach(state)))

def valid_multiworld(self, state, item):
if self.type == LocationType.Pot and self.player != item.player:
Expand Down
6 changes: 5 additions & 1 deletion Fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ def sweep_from_pool(placing_items=None):
spot_to_fill = None

item_locations = filter_locations(item_to_place, locations, world, vanilla)
# for dungeon items, it is worth reducing this list further by excluding locations outside of the respective dungeon
reduced_locations = item_locations if not item_to_place.dungeon else \
[location for location in item_locations if not location.always_allow and location.parent_region.can_fill(item_to_place)]

verify(item_to_place, item_locations, maximum_exploration_state, single_player_placement,
perform_access_check, key_pool, world)
for location in item_locations:
for location in reduced_locations:
spot_to_fill = verify_spot_to_fill(location, item_to_place, maximum_exploration_state,
single_player_placement, perform_access_check, key_pool, world)
if spot_to_fill:
Expand Down
Loading