From d92d294f906150a84accaca69ae3fa4b7fb48130 Mon Sep 17 00:00:00 2001 From: ElTata <eltata@firemail.cc> Date: Wed, 10 Jun 2020 15:04:03 +0200 Subject: [PATCH] bugfix in Main when a non-player user use help cmd --- Irpg/Main.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Irpg/Main.pm b/Irpg/Main.pm index 1b71679..0cf90c1 100644 --- a/Irpg/Main.pm +++ b/Irpg/Main.pm @@ -343,15 +343,6 @@ sub rpcheck { # check levels, update database find_item($k); challenge_opp($k); } - #if ($rps->{$k}{next_a} < 1 - # && $rps->{$k}{actions} < int($rps->{$k}{level}/10)) { - # $rps->{$k}{actions}++; - # if ($rps->{$k}{actions} < int($rps->{$k}{level}/10)) { - # $rps->{$k}{next_a} = 3600 - # } - # Irpg::Irc::notice("You feel ready to perform a new deed !", - # $rps->{$k}{nick}); - #} if ($rps->{$k}{actions} + @{$rps->{$k}{next_a}} < int($rps->{$k}{level}/10)) { Irpg::Action::new_action($k); } @@ -483,7 +474,7 @@ sub parse { $opts->{botchan} =~ s/ .*//; # strip channel key if present } elsif ($arg[1] eq '315') { - # 315 is /WHO end. report who we automagically signed online iff it will + # 315 is /WHO end. report who we automagically signed online if it will # print < 1k of text if (keys(%auto_login)) { # not a true measure of size, but easy @@ -597,7 +588,7 @@ sub help { my ($userhost, $usernick, $username, $source, @arg) = @_; my $ctxt = $source =~ m/^#/ ? 'pub' : 'prv'; my $ret = ''; - my $isadmin = $rps->{$username}{isadmin}; + my $isadmin = defined($username) ? $rps->{$username}{isadmin} : 0; if (!exists($arg[0])) { $ret = "Available commands : ". join(', ', grep({ $commands{$_}->{$ctxt} -- GitLab