From f19777404e674803decdd88e4899bab87fe863f6 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 7 Sep 2017 19:31:28 +0200 Subject: [PATCH] Bot AI: if the current goal is taken by someone keep going to the goal until it's visible, then find another goal; it reduces chances all bots find a new goal at the same time --- qcsrc/server/bot/default/havocbot/havocbot.qc | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 439ef5471..4891b8d38 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -734,19 +734,25 @@ void havocbot_movetogoal(entity this) this.goalentity.bot_pickup_respawning = false; else if(time < this.goalentity.scheduledrespawntime - 10) // item already taken (by someone else) { - this.goalentity.bot_pickup_respawning = false; - navigation_clearroute(this); - this.bot_strategytime = 0; - return; + if(checkpvs(this.origin, this.goalentity)) + { + this.goalentity.bot_pickup_respawning = false; + navigation_clearroute(this); + this.bot_strategytime = 0; + return; + } } else if(this.goalentity == this.goalcurrent) locked_goal = true; // wait for item to respawn } else if(!this.goalentity.solid) { - navigation_clearroute(this); - this.bot_strategytime = 0; - return; + if(checkpvs(this.origin, this.goalentity)) + { + navigation_clearroute(this); + this.bot_strategytime = 0; + return; + } } } if(!locked_goal) -- 2.39.2