From 29f49e498312c8fc78b3610b79e61807110bca8a Mon Sep 17 00:00:00 2001 From: Dogan Date: Mon, 7 Oct 2019 19:41:05 +0200 Subject: [PATCH] FakePopulation: add the while back --- FakePopulation/scripting/FakePopulation.sp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/FakePopulation/scripting/FakePopulation.sp b/FakePopulation/scripting/FakePopulation.sp index 5043d2a1..4aecc00b 100644 --- a/FakePopulation/scripting/FakePopulation.sp +++ b/FakePopulation/scripting/FakePopulation.sp @@ -246,9 +246,6 @@ public void CheckPopulation() { if (g_bFakePopulation[i]) iFakes++; - - if (g_bFakePopulation[i] && GetClientTeam(i) >= CS_TEAM_T) - iFakesInTeam++; } int iFakesNeeded = 0; @@ -329,9 +326,15 @@ public void CheckPopulation() } } + for(int i = 1; i <= MaxClients; i++) + { + if (g_bFakePopulation[i] && GetClientTeam(i) >= CS_TEAM_T) + iFakesInTeam++; + } + if (iFakes == iFakesNeeded && iFakesInTeam != iFakesInTeamNeeded && g_iAdminFakes == -1) { - if (iFakesInTeam < iFakesInTeamNeeded) + while (iFakesInTeam < iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) { @@ -345,7 +348,7 @@ public void CheckPopulation() } } - if (iFakesInTeam > iFakesInTeamNeeded) + while (iFakesInTeam > iFakesInTeamNeeded) { for(int i = 1; i <= MaxClients; i++) {