Warn if trigger option name doesn't match something in the yaml.

This commit is contained in:
CaitSith2 2021-02-13 13:57:52 -08:00
parent 44f4f7f20c
commit acefb47a00
1 changed files with 4 additions and 0 deletions

View File

@ -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)):