From 9a24d371f78a37e5804b8eec497245823da7f5f3 Mon Sep 17 00:00:00 2001 From: jeefo Date: Sun, 18 Sep 2016 21:57:12 +0300 Subject: [PATCH] do not set yb_quota max value depending on auto vacate feature. --- source/manager.cpp | 7 +++---- source/waypoint.cpp | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/manager.cpp b/source/manager.cpp index 95013fb..a5f1197 100644 --- a/source/manager.cpp +++ b/source/manager.cpp @@ -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 - if (!engine.IsDedicatedServer () || !yb_autovacate.GetBool () || GetBot (ent) != nullptr) + if (!engine.IsDedicatedServer () || !yb_autovacate.GetBool () || GetBot (ent)) return; if (isPlayerConnection) @@ -388,7 +388,7 @@ void BotManager::AddPlayerToCheckTeamQueue (edict_t *ent) void BotManager::VerifyPlayersHasJoinedTeam (int &desiredCount) { - if (!m_trackedPlayers.GetElementNumber ()) + if (m_trackedPlayers.IsEmpty ()) return; for (int i = 0; i < engine.MaxClients (); i++) @@ -449,8 +449,7 @@ void BotManager::MaintainBotQuota (void) if (yb_quota.GetInt () < 0) yb_quota.SetInt (0); - // always keep one slot - int maxClients = yb_autovacate.GetBool () ? engine.MaxClients () - 1 - (engine.IsDedicatedServer () ? 0 : GetHumansNum ()) : engine.MaxClients (); + int maxClients = engine.MaxClients (); if (yb_quota.GetInt () > maxClients) yb_quota.SetInt (maxClients); diff --git a/source/waypoint.cpp b/source/waypoint.cpp index 51ad335..9f594e6 100644 --- a/source/waypoint.cpp +++ b/source/waypoint.cpp @@ -1217,8 +1217,6 @@ bool Waypoint::Load (void) InitVisibilityTab (); InitExperienceTab (); - bots.InitQuota (); - extern ConVar yb_debug_goal; yb_debug_goal.SetInt (-1);