hlstats_ze: Optimize code slightly, and only count alive humans.
This commit is contained in:
parent
5cc005f9c9
commit
22e67cdc9d
@ -132,22 +132,31 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast
|
||||
bool bAwardHumans = ((g_tMinimalRoundDuration == INVALID_HANDLE) && (hEvent.GetInt("winner") == CS_TEAM_CT));
|
||||
bool bAwardZombies = ((g_tMinimalRoundDuration == INVALID_HANDLE) && (hEvent.GetInt("winner") == CS_TEAM_T));
|
||||
|
||||
int iAliveHumans;
|
||||
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (IsValidClient(client) && GetClientTeam(client) == CS_TEAM_CT)
|
||||
iAliveHumans++;
|
||||
}
|
||||
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (IsValidClient(client))
|
||||
{
|
||||
int HumanCount = GetTeamClientCount(CS_TEAM_CT);
|
||||
|
||||
if (bAwardHumans && g_bIsHuman[client] && HumanCount == 1)
|
||||
if (bAwardHumans && g_bIsHuman[client])
|
||||
{
|
||||
LogPlayerEvent(client, "triggered", "ze_h_win_solo");
|
||||
}
|
||||
else if (bAwardHumans && g_bIsHuman[client])
|
||||
{
|
||||
char sPlayerEvent[32];
|
||||
Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_h_win_%d", g_cvarDifficultyHuman.IntValue);
|
||||
if (iAliveHumans == 1)
|
||||
{
|
||||
LogPlayerEvent(client, "triggered", "ze_h_win_solo");
|
||||
}
|
||||
else
|
||||
{
|
||||
char sPlayerEvent[32];
|
||||
Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_h_win_%d", g_cvarDifficultyHuman.IntValue);
|
||||
|
||||
LogPlayerEvent(client, "triggered", sPlayerEvent);
|
||||
LogPlayerEvent(client, "triggered", sPlayerEvent);
|
||||
}
|
||||
}
|
||||
else if (bAwardZombies && g_bIsZombie[client])
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user