fix bizarre rng bug

This commit is contained in:
Al Beano 2016-07-19 17:06:59 +02:00
parent 6aac87f8c8
commit 3392e08441
1 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,8 @@ sub said {
$self->say(channel => config("irc_channel"), body => "lad");
}
my $chattiness = $redis->get("$redis_prefix:chattiness");
if (rand 100 < $chattiness) {
my $rand = rand 100;
if ($rand < $chattiness) {
# generate a shitpost
my @line = split " ", $msg->{body};
return unless scalar(@line) > 1;