Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow worlds to add options to prebuilt groups #3509

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions worlds/AutoWorld.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def __new__(mcs, name: str, bases: Tuple[type, ...], dct: Dict[str, Any]) -> Web
assert group.options, "A custom defined Option Group must contain at least one Option."
# catch incorrectly titled versions of the prebuilt groups so they don't create extra groups
title_name = group.name.title()
if title_name in prebuilt_options:
group.name = title_name
assert title_name not in prebuilt_options or title_name == group.name, \
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm fine with the assert title_name == group.name since i was on the fence about whether that should exist but the other bool here is wrong and the if immediately after this will now not be hit ever.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i thought that was an and, not an or 🤦

f"Prebuilt group name \"{group.name}\" must be \"{title_name}\""

if group.name == "Item & Location Options":
assert not any(option in item_and_loc_options for option in group.options), \
Expand Down
Loading