Core: check for key-only once in sweep (#361)
This commit is contained in:
parent
8337689640
commit
cebd7fb545
|
@ -643,11 +643,10 @@ class CollectionState():
|
||||||
locations = self.world.get_filled_locations()
|
locations = self.world.get_filled_locations()
|
||||||
new_locations = True
|
new_locations = True
|
||||||
# since the loop has a good chance to run more than once, only filter the events once
|
# since the loop has a good chance to run more than once, only filter the events once
|
||||||
locations = {location for location in locations if location.event}
|
locations = {location for location in locations if location.event and
|
||||||
|
not key_only or getattr(location.item, "locked_dungeon_item", False)}
|
||||||
while new_locations:
|
while new_locations:
|
||||||
reachable_events = {location for location in locations if
|
reachable_events = {location for location in locations if location.can_reach(self)}
|
||||||
(not key_only or getattr(location.item, "locked_dungeon_item", False))
|
|
||||||
and location.can_reach(self)}
|
|
||||||
new_locations = reachable_events - self.events
|
new_locations = reachable_events - self.events
|
||||||
for event in new_locations:
|
for event in new_locations:
|
||||||
self.events.add(event)
|
self.events.add(event)
|
||||||
|
|
Loading…
Reference in New Issue