autovacate works again
This commit is contained in:
parent
afd29925e2
commit
6c93b75f34
1 changed files with 7 additions and 1 deletions
|
|
@ -1073,6 +1073,12 @@ int ClientConnect (edict_t *ent, const char *name, const char *addr, char reject
|
|||
if (strcmp (addr, "loopback") == 0)
|
||||
g_hostEntity = ent; // save the edict of the listen server client...
|
||||
|
||||
extern ConVar yb_autovacate;
|
||||
extern ConVar yb_quota;
|
||||
|
||||
if (yb_autovacate.GetBool () && !IsValidBot (ent))
|
||||
bots.RemoveRandom ();
|
||||
|
||||
if (g_isMetamod)
|
||||
RETURN_META_VALUE (MRES_IGNORED, 0);
|
||||
|
||||
|
|
@ -1096,7 +1102,7 @@ void ClientDisconnect (edict_t *ent)
|
|||
extern ConVar yb_quota;
|
||||
|
||||
if (yb_autovacate.GetBool () && IsValidPlayer (ent) && !IsValidBot (ent) && yb_quota.GetInt () < GetMaxClients () - 1)
|
||||
yb_quota.SetInt (yb_quota.GetInt () + 1);
|
||||
bots.AddRandom ();
|
||||
|
||||
int i = IndexOfEntity (ent) - 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue