=This is quite a serious bug. Turns out that modules (of course) run in the scope of the method in which they were loaded... which means they can access variables such as 'nick' that are defined using my in the global scope. Ouch. Anyway, this fixes the problem with bots randomly losing their nick while using Karma. I would have caught it earlier, but I don't use Karma myself, so...

This commit is contained in:
ian%hixie.ch 2004-03-15 13:19:23 +00:00
parent cb1daf62f0
commit d86870c0c7

View File

@ -89,7 +89,7 @@ sub ChangeKarma {
delete($self->{'scores'}->{lc $who});
}
}
$nick = lc $event->{'userName'};
my $nick = lc $event->{'userName'};
if ($nick) {
if (not defined($self->{"privateScores"}->{$nick})) {
$self->{"privateScores"}->{$nick} = (lc($who) . ' ' . $delta);