From 8e8dfa33ed3179f548a973bc3e576075de0699a8 Mon Sep 17 00:00:00 2001 From: pizzahut2 Date: Fri, 8 Oct 2021 02:12:29 +0200 Subject: [PATCH] Update stats.sma (#1002) Triggered the "Invalid weapon id" at another location in the source code, so patched all cases where the argument could be 0. --- plugins/tfc/stats.sma | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tfc/stats.sma b/plugins/tfc/stats.sma index 4b802620..a4bc0a77 100755 --- a/plugins/tfc/stats.sma +++ b/plugins/tfc/stats.sma @@ -575,7 +575,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){ set_task( 4.0 + float( param[1] ) ,"checkKills",0,param,sizeof(param)) } - if ( xmod_is_melee_wpn(wpnindex) && ( KnifeKill || KnifeKillSound ) ){ + if ( ( KnifeKill || KnifeKillSound ) && wpnindex && xmod_is_melee_wpn(wpnindex) ){ if ( KnifeKill ){ set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) for (new i=1;i<=MaxClients;i++){ @@ -598,7 +598,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){ } } - if ( headshot && (HeadShotKill || HeadShotKillSound) && !xmod_is_melee_wpn(wpnindex) ){ + if ( headshot && (HeadShotKill || HeadShotKillSound) && wpnindex && !xmod_is_melee_wpn(wpnindex) ){ if ( HeadShotKill ){ new weapon[32], message[256] xmod_get_wpnname(wpnindex,weapon,charsmax(weapon))