[nexuiz-commits] r8312 - in trunk/data/qcsrc/server/bot: . havocbot

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Nov 22 13:01:07 EST 2009


Author: div0
Date: 2009-11-22 13:01:07 -0500 (Sun, 22 Nov 2009)
New Revision: 8312

Modified:
   trunk/data/qcsrc/server/bot/havocbot/havocbot.qc
   trunk/data/qcsrc/server/bot/navigation.qc
Log:
try to support teleport waypoints in waypoint walking


Modified: trunk/data/qcsrc/server/bot/havocbot/havocbot.qc
===================================================================
--- trunk/data/qcsrc/server/bot/havocbot/havocbot.qc	2009-11-22 17:48:29 UTC (rev 8311)
+++ trunk/data/qcsrc/server/bot/havocbot/havocbot.qc	2009-11-22 18:01:07 UTC (rev 8312)
@@ -1281,6 +1281,20 @@
 	self.havocbot_personal_waypoint_failcounter = 0;
 	self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
 
+	// if pos is inside a teleport, then let's mark it as teleport waypoint
+	for(head = world; (head = find(head, classname, "trigger_teleport")); )
+	{
+		entity s, o;
+		s = self;
+		o = other;
+		self = head;
+		other = s;
+		if(ExactTriggerHit())
+			wp.wpflags |= WAYPOINTFLAG_TELEPORT;
+		self = s;
+		other = o;
+	}
+
 	return CMD_STATUS_EXECUTING;
 }
 

Modified: trunk/data/qcsrc/server/bot/navigation.qc
===================================================================
--- trunk/data/qcsrc/server/bot/navigation.qc	2009-11-22 17:48:29 UTC (rev 8311)
+++ trunk/data/qcsrc/server/bot/navigation.qc	2009-11-22 18:01:07 UTC (rev 8312)
@@ -844,6 +844,12 @@
 		if(self.lastteleporttime>0)
 		if(time-self.lastteleporttime<0.15)
 		{
+			if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
+			if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
+			{
+				self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+				self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
+			}
 			navigation_poproute();
 			return;
 		}



More information about the nexuiz-commits mailing list