From 1cfe97ed24b1bb469cfa823c0a666d07be90afe9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 20 Jun 2018 18:23:16 +0200 Subject: [PATCH] Bot AI: avoid anticipating a new goal search if current final goal is close enough --- qcsrc/server/bot/default/navigation.qc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.39.2