From: terencehill Date: Thu, 20 Aug 2015 23:10:40 +0000 (+0200) Subject: Give a meaningful name to a variable X-Git-Tag: xonotic-v0.8.2~1891^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1887d74dfe18deac6984931812006d26a4da5c89;p=xonotic%2Fxonotic-data.pk3dir.git Give a meaningful name to a variable --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 9fa166709..3ccf95187 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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