diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 380a3e609..b27da2029 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -66,6 +66,7 @@ #include "g_party.h" #include "k_vote.h" #include "k_zvote.h" +#include "k_bot.h" #ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES #include "m_avrecorder.h" @@ -982,6 +983,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_noresults); CV_RegisterVar(&cv_badtime); CV_RegisterVar(&cv_badip); + CV_RegisterVar(&cv_botcontrol); #endif // HUD diff --git a/src/k_bot.c b/src/k_bot.c index 1bbe92c28..b41f26aec 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -32,6 +32,10 @@ #include "k_respawn.h" #include "m_easing.h" +#ifdef DEVELOP + consvar_t cv_botcontrol = CVAR_INIT ("botcontrol", "On", 0, CV_OnOff, NULL); +#endif + /*-------------------------------------------------- boolean K_AddBot(UINT8 skin, UINT8 difficulty, UINT8 *p) @@ -1516,6 +1520,13 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) return; } + // Defanging bots for testing. + #ifdef DEVELOP + if (!cv_botcontrol.value) + return; + #endif + // Actual gameplay behaviors below this block! + if (K_TryRingShooter(player) == true) { // We want to respawn. Simply hold Y and stop here! diff --git a/src/k_bot.h b/src/k_bot.h index e0d175aa5..ab75034ee 100644 --- a/src/k_bot.h +++ b/src/k_bot.h @@ -21,6 +21,10 @@ extern "C" { #endif +#ifdef DEVELOP + extern consvar_t cv_botcontrol; +#endif + // Maximum value of botvars.difficulty #define MAXBOTDIFFICULTY 13