Skip to content

Commit 36b46bf

Browse files
authored
Bot fix (#544)
* fix bot kick * fix flood "All bot profiles at this difficulty level are in use." in console
1 parent 8142303 commit 36b46bf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

regamedll/dlls/bot/cs_bot_manager.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,15 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole)
783783
if (!profile)
784784
{
785785
CONSOLE_ECHO("All bot profiles at this difficulty level are in use.\n");
786+
787+
#ifdef REGAMEDLL_FIXES
788+
// decrease the bot quota
789+
if (!isFromConsole)
790+
{
791+
CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1);
792+
}
793+
#endif
794+
786795
return true;
787796
}
788797
}
@@ -820,7 +829,10 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole)
820829
else
821830
{
822831
// decrease the bot quota
823-
CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1);
832+
if (!isFromConsole)
833+
{
834+
CVAR_SET_FLOAT("bot_quota", cv_bot_quota.value - 1);
835+
}
824836
}
825837
#endif
826838

0 commit comments

Comments
 (0)