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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri May 1 15:53:55 EDT 2009


Author: mand1nga
Date: 2009-05-01 15:53:55 -0400 (Fri, 01 May 2009)
New Revision: 6632

Modified:
   trunk/data/qcsrc/server/bots.qc
Log:
Better placement for auto generated waypoints. For example now bots can see the flags on blodprisonctf and the silvercity mega

Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc	2009-05-01 13:33:50 UTC (rev 6631)
+++ trunk/data/qcsrc/server/bots.qc	2009-05-01 19:53:55 UTC (rev 6632)
@@ -1121,8 +1121,16 @@
 	if(!bot_waypoints_for_items)
 		return;
 
+	// Center of entity
 	org = e.origin + (e.mins + e.maxs) * 0.5;
-	org_z = e.origin_z + e.mins_z - PL_MIN_z + 1;
+
+	// Calculate the altitude where the waypoint will be placed
+	traceline(e.origin, e.origin + '0 0 -65535', TRUE, e);
+	if(e.origin_z + e.mins_z - trace_endpos_z < PL_MAX_z - PL_MIN_z + 10)
+		org_z = trace_endpos_z + PL_MAX_z - PL_MIN_z;
+	else
+		org_z = e.origin_z;
+
 	e.nearestwaypointtimeout = time + 1000000000;
 	// don't spawn an item spawnfunc_waypoint if it already exists
 	w = findchain(classname, "waypoint");



More information about the nexuiz-commits mailing list