From acefb47a0063a15522d51ca6a0a93609fd430b80 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sat, 13 Feb 2021 13:57:52 -0800 Subject: [PATCH] Warn if trigger option name doesn't match something in the yaml. --- Mystery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mystery.py b/Mystery.py index fe663e40..2041294b 100644 --- a/Mystery.py +++ b/Mystery.py @@ -328,6 +328,10 @@ def roll_triggers(weights: dict) -> dict: for option_set in weights["triggers"]: try: key = get_choice("option_name", option_set) + if key not in weights: + logging.warning(f'Specified option name {option_set["option_name"]} did not ' + f'match with a root option. ' + f'This is probably in error.') trigger_result = get_choice("option_result", option_set) result = get_choice(key, weights) if result == trigger_result and roll_percentage(get_choice("percentage", option_set, 100)):