From 987569ab4235025ad7efe3817b2b049d4fda7b5a Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 12 Dec 2017 00:18:46 +0100 Subject: [PATCH] Bot AI: properly update goal when the item bot is moving to gets attached to a player (e.g. CTF flag) --- qcsrc/server/bot/default/havocbot/havocbot.qc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index fcf539f568..a125538cdd 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -732,12 +732,17 @@ void havocbot_movetogoal(entity this) bool locked_goal = false; - if(this.goalentity && wasfreed(this.goalentity)) + if((this.goalentity && wasfreed(this.goalentity)) + || (this.goalcurrent == this.goalentity && this.goalentity.tag_entity)) { navigation_clearroute(this); navigation_goalrating_timeout_force(this); return; } + else if(this.goalentity.tag_entity) + { + navigation_goalrating_timeout_expire(this, 2); + } else if(this.goalentity.bot_pickup) { if(this.goalentity.bot_pickup_respawning) -- 2.39.2