r3840 - in branches/nexuiz-2.0: . data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jul 15 05:51:11 EDT 2008


Author: div0
Date: 2008-07-15 05:51:11 -0400 (Tue, 15 Jul 2008)
New Revision: 3840

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/server/bots.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/vote.qc
Log:
r3837 | div0 | 2008-07-15 11:38:14 +0200 (Tue, 15 Jul 2008) | 2 lines
remove some more leaks
r3838 | div0 | 2008-07-15 11:43:53 +0200 (Tue, 15 Jul 2008) | 2 lines
netname is odd
r3839 | div0 | 2008-07-15 11:49:13 +0200 (Tue, 15 Jul 2008) | 2 lines
why do I need this?

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-07-15 09:49:13 UTC (rev 3839)
+++ branches/nexuiz-2.0/.patchsets	2008-07-15 09:51:11 UTC (rev 3840)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825,3828-3835
+revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825,3828-3835,3837-3839

Modified: branches/nexuiz-2.0/data/qcsrc/server/bots.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2008-07-15 09:49:13 UTC (rev 3839)
+++ branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2008-07-15 09:51:11 UTC (rev 3840)
@@ -1,6 +1,7 @@
 // rough simulation of walking from one point to another to test if a path
 // can be traveled, used by havocbot
 
+.string netname_freeme;
 
 vector stepheightvec;
 float navigation_testtracewalk;
@@ -1491,10 +1492,10 @@
 		// randomly pick a skin
 		bot_skinfornumber(floor(random() * BOTSKINS));
 	}
-	if(!cvar("g_campaign"))
-		self.netname = strzone(strcat(prefix, name, suffix));
-	else
-		self.netname = name;
+ 	if(!cvar("g_campaign"))
+ 		self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
+ 	else
+ 		self.netname = name;
 };
 
 void bot_endgame()
@@ -1899,6 +1900,15 @@
 void() havocbot_setupbot;
 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
 
+void bot_clientdisconnect()
+{
+	if (clienttype(self) != CLIENTTYPE_BOT)
+		return;
+	if(self.netname_freeme)
+		strunzone(self.netname_freeme);
+	self.netname_freeme = string_null;
+}
+
 void bot_clientconnect()
 {
 	if (clienttype(self) != CLIENTTYPE_BOT)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2008-07-15 09:49:13 UTC (rev 3839)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2008-07-15 09:51:11 UTC (rev 3840)
@@ -1094,6 +1094,9 @@
 void ClientDisconnect (void)
 {
 	float save;
+
+	bot_clientdisconnect();
+
 	if(cvar("sv_eventlog"))
 		GameLogEcho(strcat(":part:", ftos(self.playerid)), FALSE);
 	bprint ("^4",self.netname);

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-07-15 09:49:13 UTC (rev 3839)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-07-15 09:51:11 UTC (rev 3840)
@@ -724,6 +724,8 @@
 		error("empty maplist, cannot select a new map");
 	Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
 
+	if(Map_Current_Name)
+		strunzone(Map_Current_Name);
 	Map_Current_Name = strzone(argv(Map_Current)); // will be automatically freed on exit thanks to DP
 	// this may or may not be correct, but who cares, in the worst case a map
 	// isn't chosen in the first pass that should have been

Modified: branches/nexuiz-2.0/data/qcsrc/server/vote.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2008-07-15 09:49:13 UTC (rev 3839)
+++ branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2008-07-15 09:51:11 UTC (rev 3840)
@@ -405,9 +405,6 @@
 		index++;
 	}
 
-	// necessary for some of the string operations
-	vote = strzone(vote);
-
 	return vote;
 }
 




More information about the nexuiz-commits mailing list