]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Jump if touching the bottom of a teleport/jumppad waypoint from a lower position...
authorterencehill <piuntn@gmail.com>
Mon, 31 Jul 2017 20:39:41 +0000 (22:39 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 1 Aug 2017 08:53:50 +0000 (10:53 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 221333fa2415f8bce0a45040c35efca267e3612f..f5b126ff15adeddf3c9b88117eb138572dfd18f2 100644 (file)
@@ -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);