diff --git a/PBot/LagChecker.pm b/PBot/LagChecker.pm index 63b76e12..83063c56 100644 --- a/PBot/LagChecker.pm +++ b/PBot/LagChecker.pm @@ -102,14 +102,7 @@ sub lagging { if(defined $self->{pong_received} and $self->{pong_received} == 0) { # a ping has been sent (pong_received is not undef) and no pong has been received yet my $elapsed = tv_interval($self->{ping_send_time}); - my $lag_total = $elapsed; - my $len = @{ $self->{lag_history} }; - foreach my $entry (@{ $self->{lag_history} }) { - my ($send_time, $lag_result) = @{ $entry }; - $lag_total += $lag_result; - } - my $average = $lag_total / ($len + 1); - return $average >= $self->{LAG_THRESHOLD}; + return $elapsed >= $self->{LAG_THRESHOLD}; } return 0 if not defined $self->{lag_average}; diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 2ae1a4b4..6873c22e 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 329, + BUILD_REVISION => 330, BUILD_DATE => "2011-12-11", };