From 4b9e7d715ce09a820e5603af029338edef957594 Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Wed, 18 Dec 2019 20:41:59 +0100 Subject: [PATCH] Mystery: correctly parse oddly indented yaml files --- Mystery.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mystery.py b/Mystery.py index 1655c326..45025036 100644 --- a/Mystery.py +++ b/Mystery.py @@ -9,7 +9,7 @@ from Main import main as ERmain def parse_yaml(txt): ret = {} - indents = {0: ret} + indents = {len(txt) - len(txt.lstrip(' ')): ret} for line in txt.splitlines(): if not line: continue @@ -162,8 +162,7 @@ def roll_settings(weights): ret.retro = True hints = get_choice('hints') - if hints == 'on': - ret.hints = True + ret.hints = hints == 'on' weapons = get_choice('weapons') ret.swords = {'randomized': 'random',