diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 014ed5cd..1a34706b 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -472,7 +472,7 @@ sub expand_factoid_vars { $action =~ s/(? $#list; + $max = @list if $max > @list; + $min = $max if $min > $max; my $count = $max; if ($settings{'random'}) { @@ -603,8 +604,7 @@ sub expand_factoid_vars { my @choices; while ($count-- > 0) { - my $index = int rand @list; - + my $index = int rand @list; my $choice = $list[$index]; if ($settings{'unique'}) {