fix for weird IRC clients
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 21 Sep 2009 12:32:26 +0000 (12:32 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 21 Sep 2009 12:32:26 +0000 (12:32 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@7855 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

server/rcon2irc/rcon2irc.pl

index be34149..f14a3d3 100755 (executable)
@@ -201,10 +201,10 @@ sub color_dp2irc($)
                        my $oldcolor = $color;
                        $color = $color_dp2irc_table[$data];
 
-                       $color == $oldcolor ? '' :
-                       $color < 0          ? "\017" :
-                       $next eq ','        ? "\003$color\002\002" :
-                                             sprintf "\003%02d", $color;
+                       $color == $oldcolor        ? '' :
+                       $color < 0                 ? "\017" :
+                       index '0123456789,', $next ? "\003$color\002\002" :
+                                                    "\003$color";
                } :
                        die "Invalid type";
        }