From 1887d74dfe18deac6984931812006d26a4da5c89 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 21 Aug 2015 01:10:40 +0200 Subject: [PATCH] Give a meaningful name to a variable --- qcsrc/server/bot/havocbot/havocbot.qc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 2.39.2