Warn if trigger option name doesn't match something in the yaml.
This commit is contained in:
parent
44f4f7f20c
commit
acefb47a00
|
@ -328,6 +328,10 @@ def roll_triggers(weights: dict) -> dict:
|
||||||
for option_set in weights["triggers"]:
|
for option_set in weights["triggers"]:
|
||||||
try:
|
try:
|
||||||
key = get_choice("option_name", option_set)
|
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)
|
trigger_result = get_choice("option_result", option_set)
|
||||||
result = get_choice(key, weights)
|
result = get_choice(key, weights)
|
||||||
if result == trigger_result and roll_percentage(get_choice("percentage", option_set, 100)):
|
if result == trigger_result and roll_percentage(get_choice("percentage", option_set, 100)):
|
||||||
|
|
Loading…
Reference in New Issue