]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give a meaningful name to a variable
authorterencehill <piuntn@gmail.com>
Thu, 20 Aug 2015 23:10:40 +0000 (01:10 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 20 Aug 2015 23:10:40 +0000 (01:10 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 9fa1667099b4b3ac017cde9987004d58dd082192..3ccf951870f2c1de9dd6cf800815abe2050013ef 100644 (file)
@@ -856,7 +856,7 @@ void havocbot_movetogoal()
 void havocbot_chooseenemy()
 {
        entity head, best, head2;
-       float rating, bestrating, i, hf;
+       float rating, bestrating, hf;
        vector eye, v;
        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
        {
@@ -908,7 +908,8 @@ void havocbot_chooseenemy()
 
        self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
-       for(i = 0; ; ++i)
+       bool scan_transparent = false;
+       while(true)
        {
                while (head)
                {
@@ -932,13 +933,14 @@ void havocbot_chooseenemy()
                // TODO: Perform the scan when using the rifle (requires changes on the rifle code)
                if(best || self.weapons) // || self.weapon == WEP_RIFLE
                        break;
-               if(i)
+               if(scan_transparent)
                        break;
 
                // Set flags to see through transparent objects
                self.dphitcontentsmask |= DPCONTENTS_OPAQUE;
 
                head = head2;
+               scan_transparent = true;
        }
 
        // Restore hit flags