]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/roles.qc
Merge branch 'master' into Mario/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / roles.qc
index a54874786cf6df38f2f87cbf267ba88970d5fc79..f682b692630449eef191a779bb9ea8a981e81cd9 100644 (file)
@@ -69,7 +69,7 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
 
                                if ( player.team == self.team )
                                {
-                                       if ( clienttype(player) != CLIENTTYPE_REAL || discard )
+                                       if ( !IS_REAL_CLIENT(player) || discard )
                                                continue;
 
                                        if( d > friend_distance)
@@ -85,8 +85,8 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                        if( head.armorvalue && player.armorvalue > self.armorvalue)
                                                continue;
 
-                                       if( !WEPSET_EMPTY_E(head) )
-                                       if( !WEPSET_CONTAINS_ALL_EE(player, head) )
+                                       if( head.weapons )
+                                       if( head.weapons & ~player.weapons )
                                                continue;
 
                                        if (head.ammo_shells && player.ammo_shells > self.ammo_shells)
@@ -98,7 +98,10 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                        if (head.ammo_rockets && player.ammo_rockets > self.ammo_rockets)
                                                continue;
 
-                                       if (head.ammo_cells && player.ammo_cells > self.ammo_cells )
+                                       if (head.ammo_cells && player.ammo_cells > self.ammo_cells)
+                                               continue;
+
+                                       if (head.ammo_plasma && player.ammo_plasma > self.ammo_plasma)
                                                continue;
 
                                        discard = FALSE;
@@ -175,11 +178,11 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
                                continue;
                        */
 
-                       if(head.flags & FL_INWATER || head.flags & FL_PARTIALGROUND)
+                       if((head.flags & FL_INWATER) || (head.flags & FL_PARTIALGROUND))
                                continue;
 
                        // not falling
-                       if(head.flags & FL_ONGROUND == 0)
+                       if((head.flags & FL_ONGROUND) == 0)
                        {
                                traceline(head.origin, head.origin + '0 0 -1500', TRUE, world);
                                t = pointcontents(trace_endpos + '0 0 1');
@@ -269,7 +272,7 @@ void havocbot_chooserole()
 {
        dprint("choosing a role...\n");
        self.bot_strategytime = 0;
-       if (MUTATOR_CALLHOOK(HavocBot_ChooseRule))
+       if (MUTATOR_CALLHOOK(HavocBot_ChooseRole))
                return;
        else if (g_keyhunt)
                havocbot_chooserole_kh();