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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Mar 15 16:41:24 EDT 2009


Author: mand1nga
Date: 2009-03-15 16:41:24 -0400 (Sun, 15 Mar 2009)
New Revision: 6182

Modified:
   trunk/data/qcsrc/server/bots.qc
Log:
Narrow the search for nearest waypoints to no more than 1500 qu when the bot is not on the ground

Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2009-03-15 20:11:05 UTC (rev 6181)
+++ trunk/data/qcsrc/server/bots.qc	2009-03-15 20:41:24 UTC (rev 6182)
@@ -1183,7 +1183,6 @@
 	local entity w, wp, waylist;
 	local float searching, cost, cost2;
 	local vector p;
-	local float i, increment;
 	w = waylist = findchain(classname, "waypoint");
 	while (w)
 	{
@@ -1194,9 +1193,16 @@
 		w.enemy = world;
 		w = w.chain;
 	}
+
 	// try a short range search for the nearest waypoints, and expand thesearch repeatedly if none are found
+	local float i, increment, maxdistance;
 	increment = 500;
-	for(i=increment;!navigation_markroutes_nearestwaypoints(waylist, i)&&i<50000;i+=increment);
+	if(self.flags & FL_ONGROUND)
+		maxdistance = 50000;
+	else
+		maxdistance = 1500;
+	
+	for(i=increment;!navigation_markroutes_nearestwaypoints(waylist, i)&&i<maxdistance;i+=increment);
 
 	searching = TRUE;
 	while (searching)



More information about the nexuiz-commits mailing list