From a0036d7990d065e0551c1b1f9372bcbf4d34e9d5 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 31 Jul 2017 22:39:41 +0200 Subject: [PATCH] Jump if touching the bottom of a teleport/jumppad waypoint from a lower position (it fixes jumppad to Strenght in Oilrig) --- qcsrc/server/bot/default/havocbot/havocbot.qc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 221333fa2..f5b126ff1 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -754,12 +754,18 @@ void havocbot_movetogoal(entity this) if(autocvar_bot_debug_goalstack) debuggoalstack(this); + bool bunnyhop_forbidden = false;; SET_DESTCOORDS(this.goalcurrent, this.origin, destorg); // in case bot ends up inside the teleport waypoint without touching // the teleport itself, head to the teleport origin - if(this.goalcurrent.wpisbox && boxesoverlap(this.goalcurrent.absmin, this.goalcurrent.absmax, this.origin, this.origin)) + if(this.goalcurrent.wpisbox && boxesoverlap(this.goalcurrent.absmin, this.goalcurrent.absmax, this.absmin, this.absmax)) + { + bunnyhop_forbidden = true; destorg = this.goalcurrent.origin; + if(destorg.z > this.origin.z) + PHYS_INPUT_BUTTON_JUMP(this) = true; + } diff = destorg - this.origin; //dist = vlen(diff); @@ -930,8 +936,8 @@ void havocbot_movetogoal(entity this) havocbot_keyboard_movement(this, destorg); // Bunnyhop! -// if(this.aistatus & AI_STATUS_ROAMING) - if(this.goalcurrent) + //if(this.aistatus & AI_STATUS_ROAMING) + if(!bunnyhop_forbidden && this.goalcurrent) if(skill+this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset) havocbot_bunnyhop(this, dir); -- 2.39.2