Skip to content

Commit

Permalink
Bot fix (#544)
Browse files Browse the repository at this point in the history
* fix bot kick
* fix flood "All bot profiles at this difficulty level are in use." in console
  • Loading branch information
Vaqtincha authored Jun 10, 2020
1 parent 8142303 commit 36b46bf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion regamedll/dlls/bot/cs_bot_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 36b46bf

Please sign in to comment.