]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small cleanup
authorterencehill <piuntn@gmail.com>
Tue, 7 Mar 2017 01:50:35 +0000 (02:50 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 7 Mar 2017 01:50:35 +0000 (02:50 +0100)
qcsrc/server/bot/default/aim.qc

index eac7fdeb04a1cf5600dcaa350e5b392ecc35a320..0b813dae1fd5b3be51a7828a22f5c86efefef404 100644 (file)
@@ -305,9 +305,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
 
        // decide whether to fire this time
-       // note the maxfiredeviation is in degrees so this has to convert to radians first
-       //if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
-       if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
+       if ((normalize(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);