LttP: fix adjuster partial settings store crash

This commit is contained in:
Fabian Dill
2022-05-22 17:20:24 +02:00
committed by KonoTyran
parent 9eb237b3af
commit e901a87afd
2 changed files with 26 additions and 20 deletions

View File

@@ -62,7 +62,9 @@ def get_yaml_data(file) -> Union[Dict[str, str], str]:
return options
def roll_options(options: Dict[str, Union[dict, str]], plando_options: set = {"bosses", "items", "connections", "texts"}) -> Tuple[Dict[str, Union[str, bool]], Dict[str, dict]]:
def roll_options(options: Dict[str, Union[dict, str]],
plando_options: Set[str] = frozenset({"bosses", "items", "connections", "texts"})) -> \
Tuple[Dict[str, Union[str, bool]], Dict[str, dict]]:
plando_options = set(plando_options)
results = {}
rolled_results = {}
@@ -78,11 +80,11 @@ def roll_options(options: Dict[str, Union[dict, str]], plando_options: set = {"b
try:
if len(yaml_datas) == 1:
rolled_results[filename] = roll_settings(yaml_datas[0],
plando_options=plando_options)
plando_options=plando_options)
else:
for i, yaml_data in enumerate(yaml_datas):
rolled_results[f"{filename}/{i + 1}"] = roll_settings(yaml_data,
plando_options=plando_options)
plando_options=plando_options)
except Exception as e:
results[filename] = f"Failed to generate mystery in {filename}: {e}"
else: