From e0591018b3ad67d1e0c1d07dd559fc14e28e769f Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Wed, 14 Aug 2024 03:05:08 +0100 Subject: [PATCH] Update for Core: recontextualize `CollectionState.collect` (#3723) Collecting an item with prevent_sweep=True (previously event=True), no longer always returns True, so a player should only be considered to have received advancement when CollectionState.collect() returns True. --- BaseClasses.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 4f87c0e4f32c..151c69efcada 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -839,11 +839,11 @@ def resolve_recursive_dependencies(player_to_resolve: int, dependencies: Set[int self.events.add(location) item = location.item assert isinstance(item, Item), "tried to collect Event with no Item" - self.collect(item, True, location) - # Collecting an advancement item is always considered to affect logic, so it could mean the owning - # player (or any other players with logic dependent on the owning player's world) can now access - # additional locations. - received_advancement_players.add(item.player) + if self.collect(item, True, location): + # If the state changed by collecting the item, it could mean the owning player (or any other + # players with logic dependent on the owning player's world) can now access additional + # locations. + received_advancement_players.add(item.player) events_per_player = next_events_per_player # Find all players whose logic depends on a player that received advancement during this iteration.