r5819 - trunk/server/rcon2irc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Feb 10 01:14:55 EST 2009


Author: div0
Date: 2009-02-10 01:14:55 -0500 (Tue, 10 Feb 2009)
New Revision: 5819

Modified:
   trunk/server/rcon2irc/rcon2irc.pl
Log:
fix the last commit


Modified: trunk/server/rcon2irc/rcon2irc.pl
===================================================================
--- trunk/server/rcon2irc/rcon2irc.pl	2009-02-10 06:05:56 UTC (rev 5818)
+++ trunk/server/rcon2irc/rcon2irc.pl	2009-02-10 06:14:55 UTC (rev 5819)
@@ -870,7 +870,7 @@
 			# we failed to get an initial nickname
 			# change ours a bit and try again
 
-			my @alternates = ($config{irc_nick}, grep { $_ ne "" } split /\s+/, $config{irc_nick_alternates});
+			my @alternates = uniq ($config{irc_nick}, grep { $_ ne "" } split /\s+/, $config{irc_nick_alternates});
 			my $nextnick = undef;
 			for(0.. at alternates-2)
 			{
@@ -879,13 +879,17 @@
 					$nextnick = $alternates[$_+1];
 				}
 			}
-			if($store{irc_nick_requested} eq $alternates[@alternates-1])
+			if($store{irc_nick_requested} eq $alternates[@alternates-1]) # this will only happen once
 			{
 				$store{irc_nick_requested} = $alternates[0];
 				# but don't set nextnick, so we edit it
 			}
-			if(not defined $nextnick)
+			if(defined $nextnick)
 			{
+				$store{irc_nick_requested} = $nextnick;
+			}
+			else
+			{
 				for(;;)
 				{
 					if(length $store{irc_nick_requested} < 9)




More information about the nexuiz-commits mailing list