Skip to content

Commit

Permalink
Update for Core: recontextualize CollectionState.collect (#3723)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mysteryem committed Aug 14, 2024
1 parent 24f2858 commit e059101
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e059101

Please sign in to comment.