Skip to content

Commit

Permalink
Update stats.sma (#1002)
Browse files Browse the repository at this point in the history
Triggered the "Invalid weapon id" at another location in the source code, so patched all cases where the argument could be 0.
  • Loading branch information
pizzahut2 committed Oct 8, 2021
1 parent f442b3d commit 8e8dfa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/tfc/stats.sma
Expand Up @@ -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++){
Expand All @@ -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))
Expand Down

0 comments on commit 8e8dfa3

Please sign in to comment.