]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove a wasted normalize call (v is already normalized)
authorterencehill <piuntn@gmail.com>
Sat, 19 Aug 2017 15:24:27 +0000 (17:24 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 19 Aug 2017 15:24:27 +0000 (17:24 +0200)
qcsrc/server/bot/default/aim.qc

index feb19afe1f921b25fec4c0422555482c70ff1b43..8f2abb3f824b5745448a5fb4c16ab21545e5451b 100644 (file)
@@ -307,7 +307,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
 
        // decide whether to fire this time
-       if ((normalize(v) * shotdir) >= cos(maxfiredeviation * DEG2RAD))
+       if (v * shotdir >= cos(maxfiredeviation * DEG2RAD))
        if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1))
                this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5);
        //traceline(shotorg,shotorg+shotdir*1000,false,NULL);