]> git.donarmstrong.com Git - infobot.git/commitdiff
- should fix "dict 1 shit". fixed by lear
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 1 Oct 2001 13:05:50 +0000 (13:05 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 1 Oct 2001 13:05:50 +0000 (13:05 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@515 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/Dict.pl

index a32d93ee9a276d0b601381c2b32ce233270da86f..3212b6262b2f2dc6e9f80dd90df4ff7b64ea4672 100644 (file)
@@ -57,7 +57,7 @@ sub Dict {
 
        my $total = scalar @results;
 
-       if (defined $num and ($num > $total or $num < 0)) {
+       if (defined $num and ($num > $total or $num < 1)) {
            &msg($::who, "error: choice in definition is out of range.");
            return;
        }
@@ -65,7 +65,7 @@ sub Dict {
        # parse the results.
        if ($total > 1) {
            if (defined $num) {
-               $retval = sprintf("[%d/%d] %s", $num, $total, $results[$num]);
+               $retval = sprintf("[%d/%d] %s", $num, $total, $results[$num-1]);
            } else {
                # suggested by larne and others.
                my $prefix = "Dictionary '$query' ";