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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jul 25 12:33:19 EDT 2009


Author: mand1nga
Date: 2009-07-25 12:33:19 -0400 (Sat, 25 Jul 2009)
New Revision: 7265

Modified:
   trunk/data/qcsrc/server/havocbot_ons.qc
   trunk/data/qcsrc/server/havocbot_roles.qc
Log:
Complete the return of item evaluation ai to t_items.qc

Modified: trunk/data/qcsrc/server/havocbot_ons.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot_ons.qc	2009-07-25 16:31:22 UTC (rev 7264)
+++ trunk/data/qcsrc/server/havocbot_ons.qc	2009-07-25 16:33:19 UTC (rev 7265)
@@ -23,8 +23,6 @@
 .float isgenneighbor_blue, iscpneighbor_blue;
 .float isgenneighbor_red, iscpneighbor_red;
 
-float havocbot_pickupevalfunc(entity item);
-
 void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float sradius)
 {
 	local entity head;
@@ -61,7 +59,7 @@
 		if ( ((head.health || head.armorvalue) && needarmor) || (head.weapons && needweapons ) )
 		if (vlen(head.origin - org) < sradius)
 		{
-			t = havocbot_pickupevalfunc(head);
+			t = head.bot_pickupevalfunc(self, head);
 			if (t > 0)
 				navigation_routerating(head, t * ratingscale, 500);
 		}

Modified: trunk/data/qcsrc/server/havocbot_roles.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot_roles.qc	2009-07-25 16:31:22 UTC (rev 7264)
+++ trunk/data/qcsrc/server/havocbot_roles.qc	2009-07-25 16:33:19 UTC (rev 7265)
@@ -5,13 +5,6 @@
 float bot_ignore_bots;
 
 .float max_armorvalue;
-float havocbot_pickupevalfunc(entity item)
-{
-	float r;
-	r = item.bot_pickupevalfunc(self, item);
-	// print(item.classname, " ", ftos(r), "\n");
-	return r;
-}
 
 void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
 {
@@ -119,18 +112,13 @@
 			}
 
 			// Rate the item only if no one needs it, or if an enemy is closer to it
-			if (	(enemy_distance < friend_distance && distance < enemy_distance) ||
+			if ( (enemy_distance < friend_distance && distance < enemy_distance) ||
 				(friend_distance > cvar("bot_ai_friends_aware_pickup_radius") ) || !discard )
-			{
-			//	rating = head.bot_pickupevalfunc(self, head);
-				rating = havocbot_pickupevalfunc(head);
-			}
+				rating = head.bot_pickupevalfunc(self, head);
+
 		}
 		else
-		{
-		//	rating = head.bot_pickupevalfunc(self, head);
-			rating = havocbot_pickupevalfunc(head);
-		}
+			rating = head.bot_pickupevalfunc(self, head);
 
 		if(rating > 0)
 			navigation_routerating(head, rating * ratingscale, 2000);



More information about the nexuiz-commits mailing list