From 79d7b539742e873f813bfea3ae52b209aa9b274f Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 14 Apr 2018 16:32:50 +0200 Subject: [PATCH] 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) --- qcsrc/server/mutators/mutator/gamemode_ctf.qc | 4 ++++ 1 file changed, 4 insertions(+) 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); } } -- 2.39.2