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.
This commit is contained in:
pizzahut2 2021-10-08 02:12:29 +02:00 committed by GitHub
parent f442b3d84f
commit 8e8dfa33ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -575,7 +575,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
set_task( 4.0 + float( param[1] ) ,"checkKills",0,param,sizeof(param)) 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 ){ if ( KnifeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 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++){ 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 ){ if ( HeadShotKill ){
new weapon[32], message[256] new weapon[32], message[256]
xmod_get_wpnname(wpnindex,weapon,charsmax(weapon)) xmod_get_wpnname(wpnindex,weapon,charsmax(weapon))