mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Correct 0-value factoid var expansion
This commit is contained in:
parent
a2cd25facd
commit
58a629eca4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user