diff --git a/README.md b/README.md
index 5d43c508..66e3b27a 100644
--- a/README.md
+++ b/README.md
@@ -62,9 +62,10 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused
`0` disabled
`1` enabled |
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
| sv_alltalk | 0 | 0 | 4 | When players can hear each other ([further explanation](../../wiki/sv_alltalk)).
`0` dead don't hear alive
`1` no restrictions
`2` teammates hear each other
`3` Same as 2, but spectators hear everybody
`4` alive hear alive, dead hear dead and alive.
-| bot_deathmatch | 0 | 0 | 1 | Set's the mode for the zBot.
`0` disabled
`1` enable mode Deathmatch and not allow to do the scenario |
+| bot_deathmatch | 0 | 0 | 1 | Sets the mode for the zBot.
`0` disabled
`1` enable mode Deathmatch and not allow to do the scenario |
| bot_quota_mode | normal | - | - | Determines the type of quota.
`normal` default behaviour
`fill` the server will adjust bots to keep `N` players in the game, where `N` is bot_quota
`match` the server will maintain a `1:N` ratio of humans to bots, where `N` is bot_quota |
| bot_join_delay | 0 | - | - | Prevents bots from joining the server for this many seconds after a map change. |
+| bot_freeze | 0 | 0 | 1 | Prevents bots on your server from moving.
`0` disabled
`1` enabled |
| mp_item_staytime | 300 | - | - | Time to remove item that have been dropped from the players. |
| mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict.
`0` New behavior
`1` Legacy behavior|
| mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).
`0` disabled
`>0.00001` time delay to remove protection |
diff --git a/dist/game.cfg b/dist/game.cfg
index 111488d1..5befb181 100644
--- a/dist/game.cfg
+++ b/dist/game.cfg
@@ -172,7 +172,7 @@ mp_show_scenarioicon 0
// Default value: "1"
mp_old_bomb_defused_sound 1
-// Set's the mode for the zBot
+// Sets the mode for the zBot
// 0 - disabled
// 1 - enable mode Deathmatch and not allow to do the scenario
//
@@ -192,6 +192,13 @@ bot_quota_mode "normal"
// Default value: "0"
bot_join_delay 0
+// Prevents bots on your server from moving.
+// 0 - disabled (default behavior)
+// 1 - enabled
+//
+// Default value: "0"
+bot_freeze 0
+
// Debug cvar shows triggers.
// 0 - disabled (default behaviour)
// 1 - enabled
diff --git a/regamedll/dlls/bot/cs_bot_init.cpp b/regamedll/dlls/bot/cs_bot_init.cpp
index 90fd9f6e..4ed27ac5 100644
--- a/regamedll/dlls/bot/cs_bot_init.cpp
+++ b/regamedll/dlls/bot/cs_bot_init.cpp
@@ -61,6 +61,7 @@ cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVA
cvar_t cv_bot_deathmatch = { "bot_deathmatch", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t cv_bot_quota_mode = { "bot_quota_mode", "normal", FCVAR_SERVER, 0.0f, nullptr };
cvar_t cv_bot_join_delay = { "bot_join_delay", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t cv_bot_freeze = { "bot_freeze", "0", 0, 0.0f, nullptr };
#else
// Migrated to bot_quota_mode, use "match"
cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, nullptr };
@@ -129,6 +130,7 @@ void Bot_RegisterCVars()
CVAR_REGISTER(&cv_bot_deathmatch);
CVAR_REGISTER(&cv_bot_quota_mode);
CVAR_REGISTER(&cv_bot_join_delay);
+ CVAR_REGISTER(&cv_bot_freeze);
#endif
}
diff --git a/regamedll/dlls/bot/cs_bot_init.h b/regamedll/dlls/bot/cs_bot_init.h
index e50ac87d..4f62b511 100644
--- a/regamedll/dlls/bot/cs_bot_init.h
+++ b/regamedll/dlls/bot/cs_bot_init.h
@@ -61,6 +61,7 @@ extern cvar_t cv_bot_profile_db;
extern cvar_t cv_bot_deathmatch;
extern cvar_t cv_bot_quota_mode;
extern cvar_t cv_bot_join_delay;
+extern cvar_t cv_bot_freeze;
#else
extern cvar_t cv_bot_quota_match;
#endif
diff --git a/regamedll/dlls/bot/cs_bot_statemachine.cpp b/regamedll/dlls/bot/cs_bot_statemachine.cpp
index 4a7c73fb..32525264 100644
--- a/regamedll/dlls/bot/cs_bot_statemachine.cpp
+++ b/regamedll/dlls/bot/cs_bot_statemachine.cpp
@@ -31,6 +31,11 @@
// This method is the ONLY legal way to change a bot's current state
void CCSBot::SetState(BotState *state)
{
+#ifdef REGAMEDLL_ADD
+ if (cv_bot_freeze.value && state != &m_idleState)
+ return;
+#endif
+
PrintIfWatched("SetState: %s -> %s\n", m_state ? m_state->GetName() : "NULL", state->GetName());
// if we changed state from within the special Attack state, we are no longer attacking
@@ -63,6 +68,11 @@ void CCSBot::Follow(CBasePlayer *pPlayer)
if (!pPlayer)
return;
+#ifdef REGAMEDLL_ADD
+ if (cv_bot_freeze.value)
+ return;
+#endif
+
// note when we began following
if (!m_isFollowing || m_leader != pPlayer)
m_followTimestamp = gpGlobals->time;
@@ -270,6 +280,11 @@ bool CCSBot::TryToRetreat()
void CCSBot::Hunt()
{
+#ifdef REGAMEDLL_ADD
+ if (cv_bot_freeze.value)
+ return;
+#endif
+
SetState(&m_huntState);
}