From b16001bc1a5aee5e548b9d4e701e4c3296fa6604 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 10 May 2021 06:10:35 +0300 Subject: [PATCH] possible crash fix for DeathNotice --- dlls/multiplay_gamerules.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 5a4b14e0..137b3eeb 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -709,12 +709,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, const char *tau = "tau_cannon"; const char *gluon = "gluon gun"; - if( pKiller->flags & FL_CLIENT ) + if( pevInflictor ) { - killer_index = ENTINDEX( ENT( pKiller ) ); - - if( pevInflictor ) + if( pKiller->flags & FL_CLIENT ) { + killer_index = ENTINDEX( ENT( pKiller ) ); + if( pevInflictor == pKiller ) { // If the inflictor is the killer, then it must be their current weapon doing the damage @@ -730,10 +730,10 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, killer_weapon_name = STRING( pevInflictor->classname ); // it's just that easy } } - } - else - { - killer_weapon_name = STRING( pevInflictor->classname ); + else + { + killer_weapon_name = STRING( pevInflictor->classname ); + } } // strip the monster_* or weapon_* from the inflictor's classname