From: terencehill Date: Fri, 17 Mar 2017 23:49:16 +0000 (+0100) Subject: Add bot_ai_timeitems and bot_ai_timeitems_minrespawndelay cvars X-Git-Tag: xonotic-v0.8.2~43 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8bbb6e37d055ef49286543466f9e1752b721a30d Add bot_ai_timeitems and bot_ai_timeitems_minrespawndelay cvars --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 5b3105c8c1..be25fe0dcb 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -398,6 +398,8 @@ set bot_ai_aimskill_order_filter_2nd 0.4 "Movement filter" set bot_ai_aimskill_order_filter_3th 0.2 "Acceleration filter" set bot_ai_aimskill_order_filter_4th 0.4 "Position prediction filter. Used rarely" set bot_ai_aimskill_order_filter_5th 0.5 "Movement prediction filter. Used rarely" +set bot_ai_timeitems 1 "allow skilled bots to run to important items a little time before respawning" +set bot_ai_timeitems_minrespawndelay 25 "bots run to items with this minimum respawn delay before respawning" // waypoint editor enable set g_waypointeditor 0 diff --git a/qcsrc/server/bot/default/cvars.qh b/qcsrc/server/bot/default/cvars.qh index d612c7ab98..16b2aaf431 100644 --- a/qcsrc/server/bot/default/cvars.qh +++ b/qcsrc/server/bot/default/cvars.qh @@ -40,6 +40,8 @@ float autocvar_bot_ai_navigation_jetpack_mindistance; float autocvar_bot_ai_thinkinterval; bool autocvar_bot_ai_weapon_combo; float autocvar_bot_ai_weapon_combo_threshold; +bool autocvar_bot_ai_timeitems; +float autocvar_bot_ai_timeitems_minrespawndelay; string autocvar_bot_config_file; bool autocvar_bot_god; bool autocvar_bot_ignore_bots; diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc index 4f52f8b7a4..2d5075f921 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -54,9 +54,13 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float if(!it.solid) { + if(!autocvar_bot_ai_timeitems) + continue; if(!it.scheduledrespawntime) continue; - if(it.respawntime < 30 || (it.respawntimejitter && !it.itemdef.instanceOfPowerup)) + if(it.respawntime < max(11, autocvar_bot_ai_timeitems_minrespawndelay)) + continue; + if(it.respawntimejitter && !it.itemdef.instanceOfPowerup) continue; float t = 0;