Core: Require excluded locations to be reachable with full/locations accessibility (#3802)
* Make excludeds reachable * Update all_state tests
This commit is contained in:
parent
56aabe51b8
commit
06df072095
|
@ -616,8 +616,7 @@ class MultiWorld():
|
||||||
|
|
||||||
def location_relevant(location: Location) -> bool:
|
def location_relevant(location: Location) -> bool:
|
||||||
"""Determine if this location is relevant to sweep."""
|
"""Determine if this location is relevant to sweep."""
|
||||||
return location.progress_type != LocationProgressType.EXCLUDED \
|
return location.player in players["full"] or location.advancement
|
||||||
and (location.player in players["full"] or location.advancement)
|
|
||||||
|
|
||||||
def all_done() -> bool:
|
def all_done() -> bool:
|
||||||
"""Check if all access rules are fulfilled"""
|
"""Check if all access rules are fulfilled"""
|
||||||
|
|
|
@ -293,10 +293,8 @@ class WorldTestBase(unittest.TestCase):
|
||||||
if not (self.run_default_tests and self.constructed):
|
if not (self.run_default_tests and self.constructed):
|
||||||
return
|
return
|
||||||
with self.subTest("Game", game=self.game, seed=self.multiworld.seed):
|
with self.subTest("Game", game=self.game, seed=self.multiworld.seed):
|
||||||
excluded = self.multiworld.worlds[self.player].options.exclude_locations.value
|
|
||||||
state = self.multiworld.get_all_state(False)
|
state = self.multiworld.get_all_state(False)
|
||||||
for location in self.multiworld.get_locations():
|
for location in self.multiworld.get_locations():
|
||||||
if location.name not in excluded:
|
|
||||||
with self.subTest("Location should be reached", location=location.name):
|
with self.subTest("Location should be reached", location=location.name):
|
||||||
reachable = location.can_reach(state)
|
reachable = location.can_reach(state)
|
||||||
self.assertTrue(reachable, f"{location.name} unreachable")
|
self.assertTrue(reachable, f"{location.name} unreachable")
|
||||||
|
|
|
@ -37,10 +37,8 @@ class TestBase(unittest.TestCase):
|
||||||
unreachable_regions = self.default_settings_unreachable_regions.get(game_name, set())
|
unreachable_regions = self.default_settings_unreachable_regions.get(game_name, set())
|
||||||
with self.subTest("Game", game=game_name):
|
with self.subTest("Game", game=game_name):
|
||||||
multiworld = setup_solo_multiworld(world_type)
|
multiworld = setup_solo_multiworld(world_type)
|
||||||
excluded = multiworld.worlds[1].options.exclude_locations.value
|
|
||||||
state = multiworld.get_all_state(False)
|
state = multiworld.get_all_state(False)
|
||||||
for location in multiworld.get_locations():
|
for location in multiworld.get_locations():
|
||||||
if location.name not in excluded:
|
|
||||||
with self.subTest("Location should be reached", location=location.name):
|
with self.subTest("Location should be reached", location=location.name):
|
||||||
self.assertTrue(location.can_reach(state), f"{location.name} unreachable")
|
self.assertTrue(location.can_reach(state), f"{location.name} unreachable")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue