From 346dbcd522a69996a0e2236782584bc87b67cee5 Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Thu, 29 Apr 2021 00:16:00 +0200 Subject: [PATCH] Don't include spectators or unteamed players in flash detection --- scripting/get5/stats.sp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripting/get5/stats.sp b/scripting/get5/stats.sp index c7de0aee0..54e908758 100644 --- a/scripting/get5/stats.sp +++ b/scripting/get5/stats.sp @@ -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);