Skip to content

Commit

Permalink
Fixed check for result range to properly handle non-string values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vertraic committed Nov 15, 2024
1 parent 93780f9 commit e23a89a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,13 @@ def roll_triggers(weights: dict, triggers: list, valid_keys: set, type_hints: di
option_set["option_advanced"] = [[option_set["option_name"], option_set["option_compare"],
option_set["option_result"]]]
else:
split_result = option_set["option_result"].split("_")
if len(split_result) == 3 and split_result[0] == "range":
split_result = option_set["option_result"]
is_range = False
if isinstance(split_result, str):
split_result = split_result.split("_")
if len(split_result) == 3 and split_result[0] == "range":
is_range = True
if is_range:
try:
split_result[1] = int(split_result[1])
split_result[2] = int(split_result[2])
Expand Down

0 comments on commit e23a89a

Please sign in to comment.