mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Reworked bot_quota_mode and removed bot_quota_match cvar's (Migrated to bot_quota_mode)
This commit is contained in:
parent
9ed19456f0
commit
0aa974cd63
@ -39,7 +39,6 @@ cvar_t cv_bot_difficulty = { "bot_difficulty", "0", FCVAR_SERVER, 0.
|
|||||||
cvar_t cv_bot_debug = { "bot_debug", "0", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_debug = { "bot_debug", "0", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
cvar_t cv_bot_quicksave = { "bot_quicksave", "0", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_quicksave = { "bot_quicksave", "0", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
cvar_t cv_bot_quota = { "bot_quota", "0", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_quota = { "bot_quota", "0", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, nullptr };
|
|
||||||
cvar_t cv_bot_prefix = { "bot_prefix", "", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_prefix = { "bot_prefix", "", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
cvar_t cv_bot_allow_rogues = { "bot_allow_rogues", "1", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_allow_rogues = { "bot_allow_rogues", "1", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
cvar_t cv_bot_allow_pistols = { "bot_allow_pistols", "1", FCVAR_SERVER, 0.0f, nullptr };
|
cvar_t cv_bot_allow_pistols = { "bot_allow_pistols", "1", FCVAR_SERVER, 0.0f, nullptr };
|
||||||
@ -61,6 +60,9 @@ cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVA
|
|||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
cvar_t cv_bot_deathmatch = { "bot_deathmatch", "0", FCVAR_SERVER, 0.0f, nullptr };
|
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_quota_mode = { "bot_quota_mode", "normal", 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 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void InstallBotControl()
|
void InstallBotControl()
|
||||||
@ -99,7 +101,11 @@ void Bot_RegisterCVars()
|
|||||||
CVAR_REGISTER(&cv_bot_debug);
|
CVAR_REGISTER(&cv_bot_debug);
|
||||||
CVAR_REGISTER(&cv_bot_quicksave);
|
CVAR_REGISTER(&cv_bot_quicksave);
|
||||||
CVAR_REGISTER(&cv_bot_quota);
|
CVAR_REGISTER(&cv_bot_quota);
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_ADD
|
||||||
CVAR_REGISTER(&cv_bot_quota_match);
|
CVAR_REGISTER(&cv_bot_quota_match);
|
||||||
|
#endif
|
||||||
|
|
||||||
CVAR_REGISTER(&cv_bot_prefix);
|
CVAR_REGISTER(&cv_bot_prefix);
|
||||||
CVAR_REGISTER(&cv_bot_allow_rogues);
|
CVAR_REGISTER(&cv_bot_allow_rogues);
|
||||||
CVAR_REGISTER(&cv_bot_allow_pistols);
|
CVAR_REGISTER(&cv_bot_allow_pistols);
|
||||||
|
@ -39,7 +39,6 @@ extern cvar_t cv_bot_difficulty;
|
|||||||
extern cvar_t cv_bot_debug;
|
extern cvar_t cv_bot_debug;
|
||||||
extern cvar_t cv_bot_quicksave;
|
extern cvar_t cv_bot_quicksave;
|
||||||
extern cvar_t cv_bot_quota;
|
extern cvar_t cv_bot_quota;
|
||||||
extern cvar_t cv_bot_quota_match;
|
|
||||||
extern cvar_t cv_bot_prefix;
|
extern cvar_t cv_bot_prefix;
|
||||||
extern cvar_t cv_bot_allow_rogues;
|
extern cvar_t cv_bot_allow_rogues;
|
||||||
extern cvar_t cv_bot_allow_pistols;
|
extern cvar_t cv_bot_allow_pistols;
|
||||||
@ -61,4 +60,6 @@ extern cvar_t cv_bot_profile_db;
|
|||||||
#ifdef REGAMEDLL_ADD
|
#ifdef REGAMEDLL_ADD
|
||||||
extern cvar_t cv_bot_deathmatch;
|
extern cvar_t cv_bot_deathmatch;
|
||||||
extern cvar_t cv_bot_quota_mode;
|
extern cvar_t cv_bot_quota_mode;
|
||||||
|
#else
|
||||||
|
extern cvar_t cv_bot_quota_match;
|
||||||
#endif
|
#endif
|
||||||
|
@ -828,15 +828,22 @@ void CCSBotManager::MaintainBotQuota()
|
|||||||
|
|
||||||
int desiredBotCount = int(cv_bot_quota.value);
|
int desiredBotCount = int(cv_bot_quota.value);
|
||||||
int occupiedBotSlots = UTIL_BotsInGame();
|
int occupiedBotSlots = UTIL_BotsInGame();
|
||||||
#ifdef REGAMEDLL_ADD
|
|
||||||
if (Q_stricmp(cv_bot_quota_mode.string, "fill") == 0)
|
|
||||||
occupiedBotSlots += humanPlayersInGame;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
if (FStrEq(cv_bot_quota_mode.string, "fill"))
|
||||||
|
{
|
||||||
|
desiredBotCount = Q_max(0, desiredBotCount - humanPlayersInGame);
|
||||||
|
}
|
||||||
|
else if (FStrEq(cv_bot_quota_mode.string, "match"))
|
||||||
|
{
|
||||||
|
desiredBotCount = Q_max<int>(0, cv_bot_quota.value * humanPlayersInGame);
|
||||||
|
}
|
||||||
|
#else // #ifdef REGAMEDLL_ADD
|
||||||
if (cv_bot_quota_match.value > 0.0)
|
if (cv_bot_quota_match.value > 0.0)
|
||||||
{
|
{
|
||||||
desiredBotCount = int(humanPlayersInGame * cv_bot_quota_match.value);
|
desiredBotCount = int(humanPlayersInGame * cv_bot_quota_match.value);
|
||||||
}
|
}
|
||||||
|
#endif // #ifdef REGAMEDLL_ADD
|
||||||
|
|
||||||
// wait for a player to join, if necessary
|
// wait for a player to join, if necessary
|
||||||
if (cv_bot_join_after_player.value > 0.0)
|
if (cv_bot_join_after_player.value > 0.0)
|
||||||
|
@ -112,7 +112,7 @@ int UTIL_HumansInGame(bool ignoreSpectators)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
if (pPlayer->IsProxy())
|
if (ignoreSpectators && pPlayer->IsProxy())
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user