]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/havocbot.qc
Do the same for freezetag
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / havocbot.qc
index 18e4341718e67e698e12c76045a8d035418e8af8..1b9178b1774b7632c2359463a9fd777833771326 100644 (file)
@@ -1,9 +1,6 @@
 #include "havocbot.qh"
-#include "role_ctf.qc"
 #include "role_onslaught.qc"
 #include "role_keyhunt.qc"
-#include "role_freezetag.qc"
-#include "role_keepaway.qc"
 #include "role_assault.qc"
 #include "roles.qc"
 
@@ -493,8 +490,8 @@ void havocbot_movetogoal()
                {
                        if(fabs(self.velocity_z)<50)
                        {
-                               entity head, newgoal;
-                               float distance, bestdistance;
+                               entity head, newgoal = world;
+                               float distance, bestdistance = 0;
 
                                for (head = findchain(classname, "waypoint"); head; head = head.chain)
                                {
@@ -908,7 +905,7 @@ void havocbot_chooseenemy()
 
        self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
-       for(;;)
+       for(i = 0; ; ++i)
        {
                while (head)
                {
@@ -939,7 +936,6 @@ void havocbot_chooseenemy()
                self.dphitcontentsmask |= DPCONTENTS_OPAQUE;
 
                head = head2;
-               ++i;
        }
 
        // Restore hit flags
@@ -960,7 +956,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon)
        // if this weapon is scheduled for reloading, don't switch to it during combat
        if (self.weapon_load[new_weapon] < 0)
        {
-               float i, other_weapon_available;
+               float i, other_weapon_available = FALSE;
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        // if we are out of ammo for all other weapons, it's an emergency to switch to anything else