Skip to content

Commit

Permalink
Don't include spectators or unteamed players in flash detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdnk committed Apr 28, 2021
1 parent e184bb1 commit 346dbcd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripting/get5/stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,12 @@ public Action Stats_PlayerBlindEvent(Event event, const char[] name, bool dontBr
return Plugin_Continue;
}

if (GetClientTeam(attacker) != GetClientTeam(victim)) {
int victimTeam = GetClientTeam(victim);
if (victimTeam == CS_TEAM_SPECTATOR || victimTeam == CS_TEAM_NONE) {
return Plugin_Continue;
}

if (GetClientTeam(attacker) != victimTeam) {
IncrementPlayerStat(attacker, STAT_ENEMIES_FLASHED);
} else {
IncrementPlayerStat(attacker, STAT_FRIENDLIES_FLASHED);
Expand Down

0 comments on commit 346dbcd

Please sign in to comment.