diff --git a/README.md b/README.md index d62db6bd..1665ce3d 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | 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_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. | | 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 ddb2ec01..5d7de8d5 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -166,6 +166,11 @@ bot_deathmatch 0 // Default value: "normal" bot_quota_mode "normal" +// Prevents bots from joining the server for this many seconds after a map change. +// +// Default value: "0" +bot_join_delay 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 9a5d5aba..43f345a5 100644 --- a/regamedll/dlls/bot/cs_bot_init.cpp +++ b/regamedll/dlls/bot/cs_bot_init.cpp @@ -60,6 +60,7 @@ cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVA #ifdef REGAMEDLL_ADD 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 }; #else // Migrated to bot_quota_mode, use "match" cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, nullptr }; @@ -127,6 +128,7 @@ void Bot_RegisterCVars() #ifdef REGAMEDLL_ADD CVAR_REGISTER(&cv_bot_deathmatch); CVAR_REGISTER(&cv_bot_quota_mode); + CVAR_REGISTER(&cv_bot_join_delay); #endif } diff --git a/regamedll/dlls/bot/cs_bot_init.h b/regamedll/dlls/bot/cs_bot_init.h index bdf23387..e50ac87d 100644 --- a/regamedll/dlls/bot/cs_bot_init.h +++ b/regamedll/dlls/bot/cs_bot_init.h @@ -60,6 +60,7 @@ extern cvar_t cv_bot_profile_db; #ifdef REGAMEDLL_ADD extern cvar_t cv_bot_deathmatch; extern cvar_t cv_bot_quota_mode; +extern cvar_t cv_bot_join_delay; #else extern cvar_t cv_bot_quota_match; #endif diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 021b41e4..2cc2eece 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -875,6 +875,15 @@ void CCSBotManager::MaintainBotQuota() desiredBotCount = 0; } +#ifdef REGAMEDLL_ADD + // wait until the map has been loaded for a bit, to allow players to transition across + // the transition without missing the pistol round + if (static_cast(cv_bot_join_delay.value) > CSGameRules()->GetMapElapsedTime()) + { + desiredBotCount = 0; + } +#endif + // if bots will auto-vacate, we need to keep one slot open to allow players to join if (cv_bot_auto_vacate.value > 0.0) desiredBotCount = Q_min(desiredBotCount, gpGlobals->maxClients - (totalHumansInGame + 1)); diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index ad0812ee..dfa45d96 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -635,6 +635,7 @@ public: float GetRoundRemainingTimeReal() const; float GetTimeLeft() const { return m_flTimeLimit - gpGlobals->time; } float GetRoundElapsedTime() const { return gpGlobals->time - m_fRoundStartTime; } + float GetMapElapsedTime() const { return gpGlobals->time; } BOOL TeamFull(int team_id); BOOL TeamStacked(int newTeam_id, int curTeam_id);