[nexuiz-commits] r6442 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Apr 6 03:53:38 EDT 2009


Author: div0
Date: 2009-04-06 03:53:27 -0400 (Mon, 06 Apr 2009)
New Revision: 6442

Modified:
   trunk/data/qcsrc/server/bots.qc
Log:
try to fix runaway loop when loading waypoints by being more efficiently when finding waypoints near a point


Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2009-04-06 07:42:11 UTC (rev 6441)
+++ trunk/data/qcsrc/server/bots.qc	2009-04-06 07:53:27 UTC (rev 6442)
@@ -883,11 +883,12 @@
 		// Search "from" waypoint
 		if(wp_from.origin!=wp_from_pos)
 		{
-			wp_from = findchain(classname, "waypoint");
+			wp_from = findradius(wp_from_pos, 1);
 			found = FALSE;
 			while(wp_from)
 			{
 				if(vlen(wp_from.origin-wp_from_pos)<1)
+				if(wp_from.classname == "waypoint")
 				{
 					found = TRUE;
 					break;
@@ -904,11 +905,12 @@
 		}
 
 		// Search "to" waypoint
-		wp_to = findchain(classname, "waypoint");
+		wp_to = findradius(wp_to_pos, 1);
 		found = FALSE;
 		while(wp_to)
 		{
 			if(vlen(wp_to.origin-wp_to_pos)<1)
+			if(wp_to.classname == "waypoint")
 			{
 				found = TRUE;
 				break;



More information about the nexuiz-commits mailing list