From 36b46bf9963fe602e8474dcc1a8ddc24fce33249 Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Thu, 11 Jun 2020 00:23:38 +0500 Subject: [PATCH] Bot fix (#544) * fix bot kick * fix flood "All bot profiles at this difficulty level are in use." in console --- regamedll/dlls/bot/cs_bot_manager.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index c21c6ebe..7a57339a 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -783,6 +783,15 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole) if (!profile) { CONSOLE_ECHO("All bot profiles at this difficulty level are in use.\n"); + +#ifdef REGAMEDLL_FIXES + // decrease the bot quota + if (!isFromConsole) + { + CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1); + } +#endif + return true; } } @@ -820,7 +829,10 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole) else { // decrease the bot quota - CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1); + if (!isFromConsole) + { + CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1); + } } #endif