From: terencehill Date: Sun, 5 Feb 2017 18:08:40 +0000 (+0100) Subject: Fix head-banging against walls detection X-Git-Tag: xonotic-v0.8.2~202^2~20 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cec9d21095f8921fd9b05027288512960407a39b;p=xonotic%2Fxonotic-data.pk3dir.git Fix head-banging against walls detection --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index a35d312db..d523b6ab8 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -706,6 +706,7 @@ void havocbot_movetogoal(entity this) evadeobstacle = '0 0 0'; evadelava = '0 0 0'; + makevectors(this.v_angle.y * '0 1 0'); if (this.waterlevel) { if(this.waterlevel>WATERLEVEL_SWIMMING) @@ -722,11 +723,11 @@ void havocbot_movetogoal(entity this) PHYS_INPUT_BUTTON_JUMP(this) = false; } dir = normalize(flatdir); - makevectors(this.v_angle.y * '0 1 0'); } else { float s; + vector offset; if(this.aistatus & AI_STATUS_OUT_WATER) this.aistatus &= ~AI_STATUS_OUT_WATER; @@ -749,7 +750,8 @@ void havocbot_movetogoal(entity this) } // avoiding dangers and obstacles - vector dst_ahead = this.origin + this.view_ofs + this.velocity * 0.5; + offset = (vdist(this.velocity, >, 32) ? this.velocity * 0.5 : v_forward * 32); + vector dst_ahead = this.origin + this.view_ofs + offset; vector dst_down = dst_ahead - '0 0 3000'; // Look ahead