Allow worlds to add options to prebuilt groups (#3509)
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.
This commit is contained in:
parent
e755f1a0b5
commit
7299891bdf
|
@ -123,8 +123,8 @@ class WebWorldRegister(type):
|
||||||
assert group.options, "A custom defined Option Group must contain at least one Option."
|
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
|
# catch incorrectly titled versions of the prebuilt groups so they don't create extra groups
|
||||||
title_name = group.name.title()
|
title_name = group.name.title()
|
||||||
if title_name in prebuilt_options:
|
assert title_name not in prebuilt_options or title_name == group.name, \
|
||||||
group.name = title_name
|
f"Prebuilt group name \"{group.name}\" must be \"{title_name}\""
|
||||||
|
|
||||||
if group.name == "Item & Location Options":
|
if group.name == "Item & Location Options":
|
||||||
assert not any(option in item_and_loc_options for option in group.options), \
|
assert not any(option in item_and_loc_options for option in group.options), \
|
||||||
|
|
Loading…
Reference in New Issue