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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Sep 3 11:00:27 EDT 2009


Author: div0
Date: 2009-09-03 11:00:26 -0400 (Thu, 03 Sep 2009)
New Revision: 7608

Modified:
   trunk/data/qcsrc/server/bots.qc
Log:
fix routing to personal waypoints that I broke today


Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2009-09-03 14:17:49 UTC (rev 7607)
+++ trunk/data/qcsrc/server/bots.qc	2009-09-03 15:00:26 UTC (rev 7608)
@@ -1376,15 +1376,12 @@
 	pm2 = ent.origin + PL_MAX;
 	waylist = findchain(classname, "waypoint");
 
-	if(ent.classname == "waypoint")
-		error("finding a nearest waypoint to a waypoint wtf");
-
 	// do two scans, because box test is cheaper
 	w = waylist;
 	while (w)
 	{
 		// if object is touching spawnfunc_waypoint
-		//if(w != ent)
+		if(w != ent)
 			if (boxesoverlap(pm1, pm2, w.absmin, w.absmax))
 				return w;
 		w = w.chain;
@@ -1404,7 +1401,7 @@
 	while (w)
 	{
 		// if object can walk from spawnfunc_waypoint
-		//if(w != ent)
+		if(w != ent)
 		{
 			if (w.wpisbox)
 			{
@@ -1740,7 +1737,7 @@
 	//bprint(etos(e));
 	//bprint("\n");
 	// update the cached spawnfunc_waypoint link on a dynamic item entity
-	if(e.classname == "waypoint")
+	if(e.classname == "waypoint" && !(e.wpflags & WAYPOINTFLAG_PERSONAL))
 	{
 		nwp = e;
 	}
@@ -1802,7 +1799,7 @@
 		return TRUE;
 
 	// see if there are waypoints describing a path to the item
-	if(e.classname != "waypoint")
+	if(e.classname != "waypoint" || (e.wpflags & WAYPOINTFLAG_PERSONAL))
 		e = e.nearestwaypoint;
 	if(e == world)
 		return FALSE;



More information about the nexuiz-commits mailing list