Skip to content

Commit

Permalink
add comment explaining when total progression items is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie committed Dec 8, 2024
1 parent ecc69dd commit 2f62c57
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions worlds/stardew_valley/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def collect(self, state: CollectionState, item: StardewItem) -> bool:
received_progression_count = player_state[Event.received_progression_item]
received_progression_count += 1
if self.total_progression_items:
# Total progression items is not set until all items are created, but collect will be called during the item creation when an item is precollected.
# We can't update the percentage if we don't know the total progression items, can't divide by 0.
player_state[Event.received_progression_percent] = received_progression_count * 100 // self.total_progression_items
player_state[Event.received_progression_item] = received_progression_count
Expand Down

0 comments on commit 2f62c57

Please sign in to comment.