Skip to content

Conversation

@FuzzyGamesOn
Copy link
Collaborator

There was an oversight in the way that victory categories are determined that appeared to only say that the victory location had categories if at least one of the categories it had was not shared by any other location.

This PR changes that behavior to instead use the categories that the victory location had defined. This also allows the Victory location button to show up in multiple categories now, and also prevents it from showing up in (No Category) when it has categories.

… Category when victory location had categories
@silasary
Copy link
Collaborator

Oh right, we can do this now 😁

if category not in self.listed_locations:
self.listed_locations[category] = []

if len(victory_categories) == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're using len() == 0 instead of not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stemmed from a misunderstanding of how for-else works in Python, which I originally did for the for loop above. In my head, for-else would do the for if there are any iterations and do the else if no iterations. In actuality, Python just like... does both if you don't break the loop. Which is kinda goofy, lol

I can change it to not 😄

@silasary silasary merged commit 4e754f6 into main Dec 16, 2024
@silasary silasary deleted the client-bug-victory-categories branch December 16, 2024 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants