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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jun 13 05:48:05 EDT 2009


Author: div0
Date: 2009-06-13 05:48:05 -0400 (Sat, 13 Jun 2009)
New Revision: 7021

Modified:
   trunk/data/qcsrc/server/bots.qc
Log:
undo mand1nga's revert, and make it conditional on a bot_navigation_ignoreplayers cvar


Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2009-06-13 09:43:55 UTC (rev 7020)
+++ trunk/data/qcsrc/server/bots.qc	2009-06-13 09:48:05 UTC (rev 7021)
@@ -66,6 +66,7 @@
 // can be traveled, used for waypoint linking and havocbot
 
 vector stepheightvec;
+float bot_navigation_movemode;
 float navigation_testtracewalk;
 float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode)
 {
@@ -574,6 +575,7 @@
 	local vector sv, sm1, sm2, ev, em1, em2, dv;
 
 	stepheightvec = cvar("sv_stepheight") * '0 0 1';
+	bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
 	//dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
 	sm1 = self.origin + self.mins;
@@ -1514,7 +1516,7 @@
 					if (walkfromwp)
 					{
 						//print("^1can I reach ", vtos(org), " from ", vtos(v), "?\n");
-						if (tracewalk(ent, v, PL_MIN, PL_MAX, org, MOVE_NORMAL))
+						if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
 						{
 							bestdist = dist;
 							best = w;
@@ -1522,7 +1524,7 @@
 					}
 					else
 					{
-						if (tracewalk(ent, org, PL_MIN, PL_MAX, v, MOVE_NORMAL))
+						if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
 						{
 							bestdist = dist;
 							best = w;
@@ -1565,7 +1567,7 @@
 			if (vlen(diff) < maxdist)
 			{
 				head.wpconsidered = TRUE;
-				if (tracewalk(self, self.origin, self.mins, self.maxs, v, MOVE_NORMAL))
+				if (tracewalk(self, self.origin, self.mins, self.maxs, v, bot_navigation_movemode))
 				{
 					head.wpnearestpoint = v;
 					head.wpcost = vlen(v - self.origin) + head.dmg;
@@ -1798,7 +1800,7 @@
 	navigation_pushroute(e);
 
 	// if it can reach the goal there is nothing more to do
-	if (tracewalk(self, startposition, PL_MIN, PL_MAX, e.origin, MOVE_NORMAL))
+	if (tracewalk(self, startposition, PL_MIN, PL_MAX, e.origin, bot_navigation_movemode))
 		return TRUE;
 
 	// see if there are waypoints describing a path to the item
@@ -2843,6 +2845,7 @@
 		return;
 
 	stepheightvec = cvar("sv_stepheight") * '0 0 1';
+	bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
 	if(time > autoskill_nextthink)
 	{
@@ -2868,7 +2871,7 @@
 	// But don't remove bots immediately on level change, as the real players
 	// usually haven't rejoined yet
 	bots_would_leave = FALSE;
-	if (realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5))
+	if ((realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5)))
 	{
 		float realminplayers, minplayers;
 		realminplayers = cvar("minplayers");



More information about the nexuiz-commits mailing list