]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make bot head to the jumppad destination once it reaches the goal item
authorterencehill <piuntn@gmail.com>
Fri, 27 Oct 2017 18:04:26 +0000 (20:04 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 27 Oct 2017 18:04:26 +0000 (20:04 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 50359e7613d86c9e5b8c2d98d69f44cde4b3b5ba..d77c5a18eafd69d9489b464bbfe1111ff11ccc02 100644 (file)
@@ -577,6 +577,16 @@ void havocbot_movetogoal(entity this)
                        }
                        else
                        {
+                               if (this.goalcurrent.bot_pickup)
+                               {
+                                       entity jumppad_wp = this.goalcurrent_prev;
+                                       navigation_poptouchedgoals(this);
+                                       if(!this.goalcurrent && jumppad_wp.wp00)
+                                       {
+                                               // head to the jumppad destination once bot reaches the goal item
+                                               navigation_pushroute(this, jumppad_wp.wp00);
+                                       }
+                               }
                                gco = (this.goalcurrent.absmin + this.goalcurrent.absmax) * 0.5;
                                if (this.origin.z > gco.z && vdist(vec2(this.velocity), <, autocvar_sv_maxspeed))
                                        this.aistatus &= ~AI_STATUS_OUT_JUMPPAD;