]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add bot_ai_timeitems and bot_ai_timeitems_minrespawndelay cvars
authorterencehill <piuntn@gmail.com>
Fri, 17 Mar 2017 23:49:16 +0000 (00:49 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 17 Mar 2017 23:49:16 +0000 (00:49 +0100)
defaultXonotic.cfg
qcsrc/server/bot/default/cvars.qh
qcsrc/server/bot/default/havocbot/roles.qc

index 5b3105c8c1d58c9c0cc70251c64f9cad9601d2d2..be25fe0dcb3f48ac5fb71e385604fe8fe6274654 100644 (file)
@@ -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
index d612c7ab98171f224cae207f37981269aa41401e..16b2aaf4312367da99abc30e2d9427f23c1d2402 100644 (file)
@@ -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;
index 4f52f8b7a47fbc00399235cc614869e26be374dc..2d5075f921a1d34ffa77e7cc1baa6e87704cd9f4 100644 (file)
@@ -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;