From: terencehill Date: Sun, 5 May 2019 11:14:10 +0000 (+0200) Subject: Bot AI: fix vertical jumppad handling causing bots to fall down when trying to use... X-Git-Tag: xonotic-v0.8.5~1514 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b92cf47db378d672656b6552f3cd16d0b61d4817;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: fix vertical jumppad handling causing bots to fall down when trying to use a jumppad on Dance --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 31a6bf097..6c056c27e 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -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))