AntiNoob: damn fakes

and i was wondering why my calculation wasn't working
This commit is contained in:
dogan 2020-06-19 17:31:23 +02:00
parent 5bfce17da9
commit 3e1cf94a99

View File

@ -95,7 +95,7 @@ public void OnPluginStart()
g_fNapalmMidRoundReduction = cvar.FloatValue; g_fNapalmMidRoundReduction = cvar.FloatValue;
HookConVarChange((cvar = CreateConVar("sm_an_kb_midround", "5.0", "knockback boost in procent when mid round help is performed (stacking)")), g_cvKnockbackMidRoundBoost); HookConVarChange((cvar = CreateConVar("sm_an_kb_midround", "5.0", "knockback boost in procent when mid round help is performed (stacking)")), g_cvKnockbackMidRoundBoost);
g_fKnockbackMidRoundBoost = cvar.FloatValue / 100.0; g_fKnockbackMidRoundBoost = cvar.FloatValue / 100.0;
HookConVarChange((cvar = CreateConVar("sm_an_midroundratio", "1.0", "human:zombie amount ratio to perform mid round help, x = zombie")), g_cvMidRoundRatio); HookConVarChange((cvar = CreateConVar("sm_an_midroundratio", "1.01", "human:zombie amount ratio to perform mid round help, x = zombie")), g_cvMidRoundRatio);
g_fMidRoundRatio = cvar.FloatValue; g_fMidRoundRatio = cvar.FloatValue;
delete cvar; delete cvar;
@ -255,7 +255,7 @@ public void CheckHumanZombieCount()
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(!IsClientInGame(i) || IsFakeClient(i) || !IsPlayerAlive(i)) if(!IsClientInGame(i) || !IsPlayerAlive(i))
continue; continue;
if(GetClientTeam(i) == CS_TEAM_CT) if(GetClientTeam(i) == CS_TEAM_CT)
@ -265,8 +265,8 @@ public void CheckHumanZombieCount()
iZombieCount++; iZombieCount++;
} }
if(iHumanCount == 0) if(iHumanCount == 0 || iZombieCount == 0)
iHumanCount = 1; return;
if(float(iZombieCount) / float(iHumanCount) >= g_fMidRoundRatio) if(float(iZombieCount) / float(iHumanCount) >= g_fMidRoundRatio)
{ {