fix bug with sources that only have lists
This commit is contained in:
+2
-4
@@ -128,10 +128,7 @@ class DataSource:
|
||||
]
|
||||
else:
|
||||
# If the option is either a list or a string, just select it.
|
||||
if rand:
|
||||
choices = [random.choice(self.data[option])]
|
||||
else:
|
||||
choices = self.data[option]
|
||||
choices = self.data[option]
|
||||
|
||||
for choice in choices:
|
||||
# If the randomly-selected choice is a dict, choose a random item and return a list consisting
|
||||
@@ -153,6 +150,7 @@ class DataSource:
|
||||
flattened.append(choice)
|
||||
return flattened
|
||||
|
||||
|
||||
class RollTable:
|
||||
"""
|
||||
Generate a roll table using weighted distributions of random options.
|
||||
|
||||
Reference in New Issue
Block a user