]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't check if bot isn't getting closer to the current goal if it already reached...
authorterencehill <piuntn@gmail.com>
Fri, 17 Mar 2017 22:00:37 +0000 (23:00 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 17 Mar 2017 22:00:37 +0000 (23:00 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 63a9577fc165bd462c2b99fac1e47b03120c53a8..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;