Core: Make get_all_state Sweeping Optional (#4828)

This commit is contained in:
Aaron Wagener
2025-05-22 21:28:56 -05:00
committed by GitHub
parent de71677208
commit 5491f8c459

View File

@@ -439,7 +439,7 @@ class MultiWorld():
return self.regions.location_cache[player][location_name] return self.regions.location_cache[player][location_name]
def get_all_state(self, use_cache: bool, allow_partial_entrances: bool = False, def get_all_state(self, use_cache: bool, allow_partial_entrances: bool = False,
collect_pre_fill_items: bool = True) -> CollectionState: collect_pre_fill_items: bool = True, perform_sweep: bool = True) -> CollectionState:
cached = getattr(self, "_all_state", None) cached = getattr(self, "_all_state", None)
if use_cache and cached: if use_cache and cached:
return cached.copy() return cached.copy()
@@ -453,7 +453,8 @@ class MultiWorld():
subworld = self.worlds[player] subworld = self.worlds[player]
for item in subworld.get_pre_fill_items(): for item in subworld.get_pre_fill_items():
subworld.collect(ret, item) subworld.collect(ret, item)
ret.sweep_for_advancements() if perform_sweep:
ret.sweep_for_advancements()
if use_cache: if use_cache:
self._all_state = ret self._all_state = ret