Correct 0-value factoid var expansion

This commit is contained in:
Pragmatic Software 2017-09-02 01:44:57 -07:00
parent a2cd25facd
commit 58a629eca4
1 changed files with 2 additions and 2 deletions

View File

@ -415,10 +415,10 @@ sub expand_factoid_vars {
if ($self->{factoids}->hash->{$var_chan}->{$var}->{type} eq 'text') {
my $change = $self->{factoids}->hash->{$var_chan}->{$var}->{action};
my @list = split(/\s+|(".*?")/, $change);
my @list = split(/\s|(".*?")/, $change);
my @mylist;
for (my $i = 0; $i <= $#list; $i++) {
push @mylist, $list[$i] if defined $list[$i];
push @mylist, $list[$i] if defined $list[$i] and length $list[$i];
}
my $line = int(rand($#mylist + 1));
$mylist[$line] =~ s/"//g;