]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: avoid wasting a lot of CPU time when bot is playing middlefield role and...
authorterencehill <piuntn@gmail.com>
Sat, 14 Apr 2018 14:32:50 +0000 (16:32 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 14 Apr 2018 14:32:50 +0000 (16:32 +0200)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 866d7daf371550b1907beb108c7c346c6709927d..53ea68958ebf0a5c24f7c139ccd0c2f62ca13cba 100644 (file)
@@ -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);
        }
 }