Reserved slot fixes for OB games when SourceTV or Replay are enabled (bug 5499, r=drifter).
authorNicholas Hastings <skamonkey@gmail.com>
Fri Aug 30 14:15:02 2013 -0400 (2013-08-30)
changeset 41020eb66c45a884
parent 4101 ca16c2bde907
child 4103 d7471b7accc2
Reserved slot fixes for OB games when SourceTV or Replay are enabled (bug 5499, r=drifter).
plugins/reservedslots.sp
     1.1 --- a/plugins/reservedslots.sp	Fri Aug 30 14:14:59 2013 -0400
     1.2 +++ b/plugins/reservedslots.sp	Fri Aug 30 14:15:02 2013 -0400
     1.3 @@ -55,10 +55,6 @@
     1.4  new Handle:sm_reserve_maxadmins;
     1.5  new Handle:sm_reserve_kicktype;
     1.6  
     1.7 -new bool:g_BotsSubtractFromMax;
     1.8 -new g_SourceTV = -1;
     1.9 -new g_Replay = -1;
    1.10 -
    1.11  enum KickType
    1.12  {
    1.13  	Kick_HighestPing,
    1.14 @@ -79,27 +75,6 @@
    1.15  	
    1.16  	HookConVarChange(sm_reserved_slots, SlotCountChanged);
    1.17  	HookConVarChange(sm_hide_slots, SlotHideChanged);
    1.18 -	
    1.19 -	new EngineVersion:engineVersion = GetEngineVersion();
    1.20 -	g_BotsSubtractFromMax = engineVersion == Engine_TF2 || engineVersion == Engine_CSS || engineVersion == Engine_DODS || engineVersion == Engine_HL2DM;
    1.21 -	
    1.22 -	if (g_BotsSubtractFromMax)
    1.23 -	{
    1.24 -		for (new i = 1; i <= MaxClients; i++)
    1.25 -		{
    1.26 -			if (!IsClientConnected(i))
    1.27 -				continue;
    1.28 -			
    1.29 -			if (IsClientSourceTV(i))
    1.30 -			{
    1.31 -				g_SourceTV = i;
    1.32 -			}
    1.33 -			else if (IsClientReplay(i))
    1.34 -			{
    1.35 -				g_Replay = i;
    1.36 -			}
    1.37 -		}
    1.38 -	}
    1.39  }
    1.40  
    1.41  public OnPluginEnd()
    1.42 @@ -143,18 +118,6 @@
    1.43  
    1.44  public OnClientPostAdminCheck(client)
    1.45  {
    1.46 -	if (g_BotsSubtractFromMax)
    1.47 -	{
    1.48 -		if (IsClientSourceTV(client))
    1.49 -		{
    1.50 -			g_SourceTV = client;
    1.51 -		}
    1.52 -		else if (IsClientReplay(client))
    1.53 -		{
    1.54 -			g_Replay = client;
    1.55 -		}
    1.56 -	}
    1.57 -	
    1.58  	new reserved = GetConVarInt(sm_reserved_slots);
    1.59  
    1.60  	if (reserved > 0)
    1.61 @@ -235,18 +198,6 @@
    1.62  
    1.63  public OnClientDisconnect_Post(client)
    1.64  {
    1.65 -	if (g_BotsSubtractFromMax)
    1.66 -	{
    1.67 -		if (client == g_SourceTV)
    1.68 -		{
    1.69 -			g_SourceTV = -1;
    1.70 -		}
    1.71 -		else if (client == g_Replay)
    1.72 -		{
    1.73 -			g_Replay = -1;
    1.74 -		}
    1.75 -	}
    1.76 -	
    1.77  	if (GetConVarBool(sm_hide_slots))
    1.78  	{		
    1.79  		SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - GetConVarInt(sm_reserved_slots));
    1.80 @@ -297,19 +248,6 @@
    1.81  		num = limit;
    1.82  	}
    1.83  	
    1.84 -	if (g_BotsSubtractFromMax)
    1.85 -	{
    1.86 -		if (g_SourceTV > -1)
    1.87 -		{
    1.88 -			--num;
    1.89 -		}
    1.90 -		
    1.91 -		if (g_Replay > -1)
    1.92 -		{
    1.93 -			--num;
    1.94 -		}
    1.95 -	}
    1.96 -	
    1.97  	SetConVarInt(sv_visiblemaxplayers, num);
    1.98  }
    1.99