From: terencehill Date: Wed, 20 Jun 2018 16:23:16 +0000 (+0200) Subject: Bot AI: avoid anticipating a new goal search if current final goal is close enough X-Git-Tag: xonotic-v0.8.5~1923^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1cfe97ed24b1bb469cfa823c0a666d07be90afe9;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: avoid anticipating a new goal search if current final goal is close enough --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 4665be482..2bf1fda72 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -49,12 +49,15 @@ bool navigation_goalrating_timeout(entity this) #define MAX_CHASE_DISTANCE 700 bool navigation_goalrating_timeout_can_be_anticipated(entity this) { - if(time > this.bot_strategytime - (IS_MOVABLE(this.goalentity) ? 3 : 2)) + vector gco = (this.goalentity.absmin + this.goalentity.absmax) * 0.5; + if (vdist(gco - this.origin, >, autocvar_sv_maxspeed * 1.5) + && time > this.bot_strategytime - (IS_MOVABLE(this.goalentity) ? 3 : 2)) + { return true; + } if (this.goalentity.bot_pickup && time > this.bot_strategytime - 5) { - vector gco = (this.goalentity.absmin + this.goalentity.absmax) * 0.5; if(!havocbot_goalrating_item_pickable_check_players(this, this.origin, this.goalentity, gco)) { this.ignoregoal = this.goalentity;