]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: fix vertical jumppad handling causing bots to fall down when trying to use...
authorterencehill <piuntn@gmail.com>
Sun, 5 May 2019 11:14:10 +0000 (13:14 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 5 May 2019 11:14:10 +0000 (13:14 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 31a6bf0974cb83bc95edd036dbeef9c8fa028e31..6c056c27e718936952436c632f160a03c4b92872 100644 (file)
@@ -597,7 +597,10 @@ void havocbot_movetogoal(entity this)
                                }
                                vector 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;
+                               {
+                                       if (this.velocity.z < 0)
+                                               this.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
+                               }
                                else if(havocbot_checkgoaldistance(this, gco))
                                {
                                        navigation_clearroute(this);
@@ -609,7 +612,7 @@ void havocbot_movetogoal(entity this)
                }
                else //if (!(this.aistatus & AI_STATUS_OUT_JUMPPAD))
                {
-                       if(this.origin.z - this.lastteleport_origin.z > (this.maxs.z - this.mins.z) * 0.5)
+                       if(this.velocity.z > 0 && this.origin.z - this.lastteleport_origin.z > (this.maxs.z - this.mins.z) * 0.5)
                        {
                                vector velxy = this.velocity; velxy_z = 0;
                                if(vdist(velxy, <, autocvar_sv_maxspeed * 0.2))