From: terencehill Date: Mon, 31 Jul 2017 20:39:41 +0000 (+0200) Subject: Jump if touching the bottom of a teleport/jumppad waypoint from a lower position... X-Git-Tag: xonotic-v0.8.5~2378^2~97 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0036d7990d065e0551c1b1f9372bcbf4d34e9d5;p=xonotic%2Fxonotic-data.pk3dir.git Jump if touching the bottom of a teleport/jumppad waypoint from a lower position (it fixes jumppad to Strenght in Oilrig) --- 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);