From: terencehill Date: Fri, 20 Jan 2017 18:42:13 +0000 (+0100) Subject: Allow bots to run to powerups and megas a little time before they respawn X-Git-Tag: xonotic-v0.8.2~202^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3fdabd2602ebca83a4a90dba1616fb4a942f3075;p=xonotic%2Fxonotic-data.pk3dir.git Allow bots to run to powerups and megas a little time before they respawn --- diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc index f57a18fed..ebdca2d89 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -23,8 +23,24 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float { rating = 0; + if(!it.solid) + { + if(!it.scheduledrespawntime) + continue; + if(it.respawntime < 30 || (it.respawntimejitter && !it.itemdef.instanceOfPowerup)) + continue; + + float t = 0; + if(it.itemdef.instanceOfPowerup) + t = bound(0, skill / 10, 1) * 6; + else if(skill >= 9) + t = 4; + + if(time < it.scheduledrespawntime - t) + continue; + } o = (it.absmin + it.absmax) * 0.5; - if(!it.solid || vdist(o - org, >, sradius) || (it == this.ignoregoal && time < this.ignoregoaltime) ) + if(vdist(o - org, >, sradius) || (it == this.ignoregoal && time < this.ignoregoaltime) ) continue; // Check if the item can be picked up safely