]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Stop bunnyhoping when bot slows down for some reason
authorterencehill <piuntn@gmail.com>
Wed, 8 Feb 2017 13:18:54 +0000 (14:18 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 8 Feb 2017 23:23:39 +0000 (00:23 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 13b8739d75af980a7ff162ea9a480fc443f9fb50..fad7dbda7b0d573a75aff2f9bdbaa63187be6ea1 100644 (file)
@@ -290,7 +290,8 @@ void havocbot_bunnyhop(entity this, vector dir)
 
        maxspeed = autocvar_sv_maxspeed;
 
-       if(this.aistatus & AI_STATUS_DANGER_AHEAD)
+       if(this.aistatus & AI_STATUS_RUNNING && vdist(this.velocity, <, autocvar_sv_maxspeed * 0.75)
+               || this.aistatus & AI_STATUS_DANGER_AHEAD)
        {
                this.aistatus &= ~AI_STATUS_RUNNING;
                PHYS_INPUT_BUTTON_JUMP(this) = false;