From 8bbb6e37d055ef49286543466f9e1752b721a30d Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 18 Mar 2017 00:49:16 +0100 Subject: [PATCH] Add bot_ai_timeitems and bot_ai_timeitems_minrespawndelay cvars --- defaultXonotic.cfg | 2 ++ qcsrc/server/bot/default/cvars.qh | 2 ++ qcsrc/server/bot/default/havocbot/roles.qc | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 5b3105c8c..be25fe0dc 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 d612c7ab9..16b2aaf43 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 4f52f8b7a..2d5075f92 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; -- 2.39.2