Core: call from_any on the options class when creating item links options ()

This commit is contained in:
Aaron Wagener 2024-03-07 01:40:09 -06:00 committed by GitHub
parent ac791f2999
commit c6b1039e0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -422,9 +422,9 @@ class World(metaclass=AutoWorldRegister):
An example case is ItemLinks creating these."""
# TODO remove loop when worlds use options dataclass
for option_key, option in cls.options_dataclass.type_hints.items():
getattr(multiworld, option_key)[new_player_id] = option(option.default)
getattr(multiworld, option_key)[new_player_id] = option.from_any(option.default)
group = cls(multiworld, new_player_id)
group.options = cls.options_dataclass(**{option_key: option(option.default)
group.options = cls.options_dataclass(**{option_key: option.from_any(option.default)
for option_key, option in cls.options_dataclass.type_hints.items()})
return group