From: mand1nga Date: Wed, 20 Apr 2011 05:27:58 +0000 (-0300) Subject: Added cvar bot_wander_enable X-Git-Tag: xonotic-v0.5.0~109^2~21^2~14^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=978e0f542187c86755a47b411e274958399f5858;p=xonotic%2Fxonotic-data.pk3dir.git Added cvar bot_wander_enable --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e4e43babe..142431b44 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -418,6 +418,7 @@ seta bot_suffix "" "Suffix behind the bot names" seta skill_auto 0 "when 1, \"skill\" gets adjusted to match the best player on the map" set bot_debug_tracewalk 0 "Enable visual indicators for short-term navigation. Green: Goal Reached / Yellow: Obstacle found / Red: Unsolvable obstacle found" set bot_debug_goalstack 0 "Visualize the current path that each bot is following. Use with as few bots as possible." +set bot_wander_enable 1 "Have bots wander around if they are unable to reach any useful goal. Disable only for debugging purposes." // general bot AI cvars set bot_ai_thinkinterval 0.05 set bot_ai_strategyinterval 5 "How often a new objective is chosen" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 467838ca2..2a99f5032 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -56,6 +56,7 @@ float autocvar_bot_usemodelnames; float autocvar_bot_vs_human; float autocvar_bot_debug_tracewalk; float autocvar_bot_debug_goalstack; +float autocvar_bot_wander_enable; float autocvar_captureleadlimit_override; #define autocvar_capturelimit_override cvar("capturelimit_override") float autocvar_deathmatch_force_teamplay; diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 95f5d5f00..e460bdc57 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -906,8 +906,10 @@ void navigation_goalrating_end() // Hack: if it can't walk to any goal just move blindly to the first visible waypoint if not (self.navigation_hasgoals) + if (autocvar_bot_wander_enable) { - dprint(self.netname, " can't walk to any goal, going to a near waypoint\n"); + if not(autocvar_g_campaign) + dprint(self.netname, " can't walk to any goal, going to a near waypoint\n"); entity head;