From 06df072095deae83a41d67f3fb8b30053c2545ef Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:49:37 -0400 Subject: [PATCH] Core: Require excluded locations to be reachable with full/locations accessibility (#3802) * Make excludeds reachable * Update all_state tests --- BaseClasses.py | 3 +-- test/bases.py | 8 +++----- test/general/test_reachability.py | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 95f24af2..68b41001 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -616,8 +616,7 @@ class MultiWorld(): def location_relevant(location: Location) -> bool: """Determine if this location is relevant to sweep.""" - return location.progress_type != LocationProgressType.EXCLUDED \ - and (location.player in players["full"] or location.advancement) + return location.player in players["full"] or location.advancement def all_done() -> bool: """Check if all access rules are fulfilled""" diff --git a/test/bases.py b/test/bases.py index 9fb223af..83461b15 100644 --- a/test/bases.py +++ b/test/bases.py @@ -293,13 +293,11 @@ class WorldTestBase(unittest.TestCase): if not (self.run_default_tests and self.constructed): return 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) for location in self.multiworld.get_locations(): - if location.name not in excluded: - with self.subTest("Location should be reached", location=location.name): - reachable = location.can_reach(state) - self.assertTrue(reachable, f"{location.name} unreachable") + with self.subTest("Location should be reached", location=location.name): + reachable = location.can_reach(state) + self.assertTrue(reachable, f"{location.name} unreachable") with self.subTest("Beatable"): self.multiworld.state = state self.assertBeatable(True) diff --git a/test/general/test_reachability.py b/test/general/test_reachability.py index 4b71762f..d50013cc 100644 --- a/test/general/test_reachability.py +++ b/test/general/test_reachability.py @@ -37,12 +37,10 @@ class TestBase(unittest.TestCase): unreachable_regions = self.default_settings_unreachable_regions.get(game_name, set()) with self.subTest("Game", game=game_name): multiworld = setup_solo_multiworld(world_type) - excluded = multiworld.worlds[1].options.exclude_locations.value state = multiworld.get_all_state(False) for location in multiworld.get_locations(): - if location.name not in excluded: - with self.subTest("Location should be reached", location=location.name): - self.assertTrue(location.can_reach(state), f"{location.name} unreachable") + with self.subTest("Location should be reached", location=location.name): + self.assertTrue(location.can_reach(state), f"{location.name} unreachable") for region in multiworld.get_regions(): if region.name in unreachable_regions: