From b92cf47db378d672656b6552f3cd16d0b61d4817 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 5 May 2019 13:14:10 +0200 Subject: [PATCH] Bot AI: fix vertical jumppad handling causing bots to fall down when trying to use a jumppad on Dance --- qcsrc/server/bot/default/havocbot/havocbot.qc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)) -- 2.39.2