]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/havocbot/havocbot.qc
Merge branch 'Mario/mutator_array_fix'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / havocbot / havocbot.qc
index 038aea0f647ca6764c17f796e8994e169d4a8fc2..42f51af8c7f279c3e1e510fd2ff3c1e56dd469d0 100644 (file)
@@ -782,9 +782,9 @@ void havocbot_movetogoal(entity this)
                        }
 
                        // if bot for some reason doesn't get close to the current goal find another one
-                       float curr_dist = vlen(this.origin - this.goalcurrent.origin);
-                       if(!IS_PLAYER(this.goalcurrent))
+                       if(!IS_PLAYER(this.goalcurrent) && !(this.goalcurrent.bot_pickup_respawning && this.goalcurrent_distance < 50))
                        {
+                               float curr_dist = vlen(this.origin - this.goalcurrent.origin);
                                if(this.goalcurrent != this.goalcurrent_prev)
                                {
                                        this.goalcurrent_prev = this.goalcurrent;
@@ -1190,18 +1190,16 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
 
 void havocbot_aim(entity this)
 {
-       vector myvel, enemyvel;
-//     if(this.flags & FL_INWATER)
-//             return;
        if (time < this.nextaim)
                return;
        this.nextaim = time + 0.1;
-       myvel = this.velocity;
+       vector myvel = this.velocity;
        if (!this.waterlevel)
                myvel.z = 0;
-       if (this.enemy)
+       if(MUTATOR_CALLHOOK(HavocBot_Aim, this)) { /* do nothing */ }
+       else if (this.enemy)
        {
-               enemyvel = this.enemy.velocity;
+               vector enemyvel = this.enemy.velocity;
                if (!this.enemy.waterlevel)
                        enemyvel.z = 0;
                lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);