Skip to content

Commit

Permalink
Allow worlds to add options to prebuilt groups (ArchipelagoMW#3509)
Browse files Browse the repository at this point in the history
Previously, this crashed because `typing.NamedTuple` fields such as
`group.name` aren't assignable. Now it will only fail for group names
that are actually incorrectly cased, and will fail with a better error
message.
  • Loading branch information
nex3 authored Jun 12, 2024
1 parent e755f1a commit 7299891
Showing 1 changed file with 2 additions and 2 deletions.
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, \
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

0 comments on commit 7299891

Please sign in to comment.