From 945b81f12d29237607c06b348a58af584078a91c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 30 May 2020 02:47:08 -0700 Subject: [PATCH] Factoids: properly set range for pick $variable modifier --- PBot/Factoids.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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'}) {