From: terencehill Date: Sat, 14 Apr 2018 14:32:50 +0000 (+0200) Subject: Bot AI: avoid wasting a lot of CPU time when bot is playing middlefield role and... X-Git-Tag: xonotic-v0.8.5~1923^2~65 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79d7b539742e873f813bfea3ae52b209aa9b274f;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: avoid wasting a lot of CPU time when bot is playing middlefield role and picks enemy base as goal (it doesn't happen often though) --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 866d7daf3..53ea68958 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -1966,6 +1966,10 @@ void havocbot_role_ctf_middle(entity this) navigation_goalrating_end(this); + entity goal = this.goalentity; + if (havocbot_ctf_is_basewaypoint(goal) && vdist(goal.origin - this.origin, <, 100)) + this.goalentity_lock_timeout = time + 2; + navigation_goalrating_timeout_set(this); } }