Updated Reserved Slots to use max humans as max count (bug 5444, r=asherkin).
authorNicholas Hastings <skamonkey@gmail.com>
Sun Dec 02 15:37:13 2012 -0500 (2012-12-02)
changeset 3697735dc2e19807
parent 3696 9588d737efe0
child 3698 421f9e288baf
Updated Reserved Slots to use max humans as max count (bug 5444, r=asherkin).
plugins/reservedslots.sp
     1.1 --- a/plugins/reservedslots.sp	Sun Dec 02 11:03:27 2012 -0500
     1.2 +++ b/plugins/reservedslots.sp	Sun Dec 02 15:37:13 2012 -0500
     1.3 @@ -111,7 +111,7 @@
     1.4  {
     1.5  	if (GetConVarBool(sm_hide_slots))
     1.6  	{		
     1.7 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - GetConVarInt(sm_reserved_slots));
     1.8 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
     1.9  	}
    1.10  }
    1.11  
    1.12 @@ -119,7 +119,7 @@
    1.13  {
    1.14  	if (GetConVarBool(sm_hide_slots))
    1.15  	{
    1.16 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - GetConVarInt(sm_reserved_slots));
    1.17 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
    1.18  	}	
    1.19  }
    1.20  
    1.21 @@ -134,7 +134,7 @@
    1.22  	
    1.23  	if (GetConVarBool(sm_hide_slots))
    1.24  	{				
    1.25 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - GetConVarInt(sm_reserved_slots));
    1.26 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
    1.27  	}
    1.28  	
    1.29  	return Plugin_Handled;
    1.30 @@ -159,7 +159,7 @@
    1.31  	if (reserved > 0)
    1.32  	{
    1.33  		new clients = GetClientCount(false);
    1.34 -		new limit = MaxClients - reserved;
    1.35 +		new limit = GetMaxHumanPlayers() - reserved;
    1.36  		new flags = GetUserFlagBits(client);
    1.37  		
    1.38  		new type = GetConVarInt(sm_reserve_type);
    1.39 @@ -248,7 +248,7 @@
    1.40  	
    1.41  	if (GetConVarBool(sm_hide_slots))
    1.42  	{		
    1.43 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - GetConVarInt(sm_reserved_slots));
    1.44 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
    1.45  	}
    1.46  	
    1.47  	if (g_isAdmin[client])
    1.48 @@ -268,7 +268,7 @@
    1.49  	}
    1.50  	else if (GetConVarBool(sm_hide_slots))
    1.51  	{
    1.52 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - slotcount);
    1.53 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - slotcount);
    1.54  	}
    1.55  }
    1.56  
    1.57 @@ -281,7 +281,7 @@
    1.58  	}
    1.59  	else
    1.60  	{
    1.61 -		SetVisibleMaxSlots(GetClientCount(false), MaxClients - GetConVarInt(sm_reserved_slots));
    1.62 +		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
    1.63  	}
    1.64  }
    1.65  
    1.66 @@ -289,9 +289,9 @@
    1.67  {
    1.68  	new num = clients;
    1.69  	
    1.70 -	if (clients == MaxClients)
    1.71 +	if (clients == GetMaxHumanPlayers())
    1.72  	{
    1.73 -		num = MaxClients;
    1.74 +		num = GetMaxHumanPlayers();
    1.75  	} else if (clients < limit) {
    1.76  		num = limit;
    1.77  	}