do not set yb_quota max value depending on auto vacate feature.

This commit is contained in:
jeefo 2016-09-18 21:57:12 +03:00
commit 9a24d371f7
2 changed files with 3 additions and 6 deletions

View file

@ -348,7 +348,7 @@ void BotManager::AdjustQuota (bool isPlayerConnection, edict_t *ent)
{ {
// this function increases or decreases bot quota amount depending on auto vacate variables // this function increases or decreases bot quota amount depending on auto vacate variables
if (!engine.IsDedicatedServer () || !yb_autovacate.GetBool () || GetBot (ent) != nullptr) if (!engine.IsDedicatedServer () || !yb_autovacate.GetBool () || GetBot (ent))
return; return;
if (isPlayerConnection) if (isPlayerConnection)
@ -388,7 +388,7 @@ void BotManager::AddPlayerToCheckTeamQueue (edict_t *ent)
void BotManager::VerifyPlayersHasJoinedTeam (int &desiredCount) void BotManager::VerifyPlayersHasJoinedTeam (int &desiredCount)
{ {
if (!m_trackedPlayers.GetElementNumber ()) if (m_trackedPlayers.IsEmpty ())
return; return;
for (int i = 0; i < engine.MaxClients (); i++) for (int i = 0; i < engine.MaxClients (); i++)
@ -449,8 +449,7 @@ void BotManager::MaintainBotQuota (void)
if (yb_quota.GetInt () < 0) if (yb_quota.GetInt () < 0)
yb_quota.SetInt (0); yb_quota.SetInt (0);
// always keep one slot int maxClients = engine.MaxClients ();
int maxClients = yb_autovacate.GetBool () ? engine.MaxClients () - 1 - (engine.IsDedicatedServer () ? 0 : GetHumansNum ()) : engine.MaxClients ();
if (yb_quota.GetInt () > maxClients) if (yb_quota.GetInt () > maxClients)
yb_quota.SetInt (maxClients); yb_quota.SetInt (maxClients);

View file

@ -1217,8 +1217,6 @@ bool Waypoint::Load (void)
InitVisibilityTab (); InitVisibilityTab ();
InitExperienceTab (); InitExperienceTab ();
bots.InitQuota ();
extern ConVar yb_debug_goal; extern ConVar yb_debug_goal;
yb_debug_goal.SetInt (-1); yb_debug_goal.SetInt (-1);