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 31a6bf0..6c056c2 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))