spheres should ignore empty locations

This commit is contained in:
Fabian Dill 2021-02-27 18:58:17 +01:00
parent 8bfddb7fc6
commit 612c3c23c0
2 changed files with 3 additions and 7 deletions

View File

@ -415,8 +415,7 @@ class MultiWorld():
def get_spheres(self):
state = CollectionState(self)
locations = set(self.get_locations())
locations = set(self.get_filled_locations())
while locations:
sphere = set()
@ -424,10 +423,7 @@ class MultiWorld():
for location in locations:
if location.can_reach(state):
sphere.add(location)
sphere_list = list(sphere)
sphere_list.sort(key=lambda location: location.name)
self.random.shuffle(sphere_list)
yield sphere_list
yield sphere
if not sphere:
if locations:
yield locations # unreachable locations

View File

@ -164,7 +164,7 @@ def ShopSlotFill(world):
blacklist_word in item_name for blacklist_word in blacklist_words)}
blacklist_words.add("Bee")
locations_per_sphere = list(list(sphere) for sphere in world.get_spheres())
locations_per_sphere = list(list(sphere).sort(key=lambda location: location.name) for sphere in world.get_spheres())