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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Apr 2 22:36:40 EDT 2009


Author: mand1nga
Date: 2009-04-02 22:36:39 -0400 (Thu, 02 Apr 2009)
New Revision: 6418

Modified:
   trunk/data/qcsrc/server/havocbot.qc
   trunk/data/qcsrc/server/havocbot_roles.qc
Log:
Fix a bug in the strafing code
If the bot is carrying the flag it will search for health/armor only if its health is below 100


Modified: trunk/data/qcsrc/server/havocbot.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot.qc	2009-04-02 23:19:17 UTC (rev 6417)
+++ trunk/data/qcsrc/server/havocbot.qc	2009-04-03 02:36:39 UTC (rev 6418)
@@ -256,8 +256,14 @@
 			while (deviation_y < -180) deviation_y = deviation_y + 360;
 			while (deviation_y > 180) deviation_y = deviation_y - 360;
 
-			if(fabs(deviation_y)>5)
+			if(fabs(deviation_y)>10)
 				self.movement_x = 0;
+
+			if(deviation_y>10)
+				self.movement_y = maxspeed * -1;
+			else if(deviation_y<10)
+				self.movement_y = maxspeed;
+
 		}
 	}
 };

Modified: trunk/data/qcsrc/server/havocbot_roles.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot_roles.qc	2009-04-02 23:19:17 UTC (rev 6417)
+++ trunk/data/qcsrc/server/havocbot_roles.qc	2009-04-03 02:36:39 UTC (rev 6418)
@@ -440,8 +440,10 @@
 		{
 			// can't navigate to our own flag :(
 			Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
+			return;
 		}
-		havocbot_goalrating_ctf_carrieritems(1000, self.origin, 1000);
+		if(self.health<100)
+			havocbot_goalrating_ctf_carrieritems(1000, self.origin, 1000);
 		navigation_goalrating_end();
 	}
 };



More information about the nexuiz-commits mailing list