From b241eaaca0bfad0cb6c95b41955df86108d1ca1a Mon Sep 17 00:00:00 2001 From: Dogan Date: Mon, 7 Oct 2019 01:53:24 +0200 Subject: [PATCH] fix infinite loop and disable userinfo change - userinfo needs to be fixed by botox - add fakes in teams back since its fixed --- FakePopulation/scripting/FakePopulation.sp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/FakePopulation/scripting/FakePopulation.sp b/FakePopulation/scripting/FakePopulation.sp index ebe2b6e9..365382fe 100644 --- a/FakePopulation/scripting/FakePopulation.sp +++ b/FakePopulation/scripting/FakePopulation.sp @@ -203,7 +203,7 @@ public void OnClientDisconnect(int client) } } -public void OnClientSettingsChanged(int client) +/*public void OnClientSettingsChanged(int client) { if(!g_bFakePopulation[client]) return; @@ -220,7 +220,7 @@ public void OnClientSettingsChanged(int client) aData[105] = 0; SetStringTableData(g_iUserInfoStringTable, client - 1, aData, len); -} +}*/ //---------------------------------------------------------------------------------------------------- // Purpose: @@ -247,7 +247,7 @@ public void CheckPopulation() if (g_bFakePopulation[i]) iFakes++; - if (g_bFakePopulation[i] && GetClientTeam(i) > 0) + if (g_bFakePopulation[i] && GetClientTeam(i) <= CS_TEAM_SPECTATOR) iFakesInTeam++; } @@ -266,16 +266,17 @@ public void CheckPopulation() else if(iPlayers > 55) { iFakesNeeded = 1; + iFakesInTeamNeeded = 1; } else if (iPlayers > 20) { iFakesNeeded = 4; - iFakesInTeamNeeded = 0; + iFakesInTeamNeeded = 2; } else if (iPlayers > 10) { iFakesNeeded = 3; - iFakesInTeamNeeded = 0; + iFakesInTeamNeeded = 1; } else if (iPlayers > 5) { @@ -330,7 +331,7 @@ public void CheckPopulation() if (iFakes == iFakesNeeded && iFakesInTeam != iFakesInTeamNeeded && g_iAdminFakes == -1) { - while (iFakesInTeam < iFakesInTeamNeeded) + if (iFakesInTeam < iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) { @@ -344,7 +345,7 @@ public void CheckPopulation() } } - while (iFakesInTeam > iFakesInTeamNeeded) + if (iFakesInTeam > iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) {