]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/aim.qc
Merge remote-tracking branch 'origin/terencehill/bot_waypoints'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / aim.qc
index ae133b4ed0382f2c77ff0be9b0e3a27b60fa09d1..7af3fab05eef57c376298e302347b6d2bf4ef9bf 100644 (file)
@@ -173,12 +173,11 @@ void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1,
 void bot_aim_reset(entity this)
 {
        this.bot_aimdir_executed = true;
-       makevectors(this.v_angle);
        this.bot_badaimtime = 0;
        this.bot_aimthinktime = time;
        this.bot_prevaimtime = time;
-       this.bot_mouseaim = v_forward;
-       this.bot_olddesiredang = v_forward;
+       this.bot_mouseaim = this.v_angle;
+       this.bot_olddesiredang = this.v_angle;
        this.bot_1st_order_aimfilter = '0 0 0';
        this.bot_2nd_order_aimfilter = '0 0 0';
        this.bot_3th_order_aimfilter = '0 0 0';
@@ -351,20 +350,12 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed
 {
        float r, hf, distanceratio;
        vector v;
-       /*
-       eprint(this);
-       dprint("bot_aim(", ftos(shotspeed));
-       dprint(", ", ftos(shotspeedupward));
-       dprint(", ", ftos(maxshottime));
-       dprint(", ", ftos(applygravity));
-       dprint(");\n");
-       */
-
        hf = this.dphitcontentsmask;
        this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
-       shotspeed *= W_WeaponSpeedFactor(this);
-       shotspeedupward *= W_WeaponSpeedFactor(this);
+       float speed_factor = W_WeaponSpeedFactor(this);
+       shotspeed *= speed_factor;
+       shotspeedupward *= speed_factor;
        if (!shotspeed)
        {
                LOG_TRACE("bot_aim: WARNING: weapon ", this.(weaponentity).m_weapon.m_name, " shotspeed is zero!");