Check for negative strikes in karma (#265)

Commit 5e157d2 introduced this bug: for negative karma, we have to check against negative strikes
This commit is contained in:
Daniel B 2016-05-10 00:26:24 +02:00 committed by Matt Simerson
parent a8747407be
commit f8c66145a1

View File

@ -449,7 +449,7 @@ sub disconnect_handler {
my $history = ($nice || 0) - $naughty; my $history = ($nice || 0) - $naughty;
my $log_mess = ''; my $log_mess = '';
if ($karma <= $self->{_args}{strikes}) { # Enough negative strikes ? if ($karma <= -$self->{_args}{strikes}) { # Enough negative strikes ?
$history--; $history--;
my $negative_limit = 0 - $self->{_args}{negative}; my $negative_limit = 0 - $self->{_args}{negative};
if ($history <= $negative_limit) { if ($history <= $negative_limit) {