From: terencehill Date: Thu, 7 Sep 2017 17:31:28 +0000 (+0200) Subject: Bot AI: if the current goal is taken by someone keep going to the goal until it's... X-Git-Tag: xonotic-v0.8.5~2378^2~72 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f19777404e674803decdd88e4899bab87fe863f6;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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)