From db59cd3c4da50a13534e967b98b19a8ab58bffd7 Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Fri, 17 Jun 2016 01:39:30 +0300 Subject: [PATCH] Fixed DeathNotice hook crash (#12) --- reapi/src/hook_callback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index 5952f41..c1e5a95 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -511,7 +511,7 @@ void CSGameRules_DeathNotice(IReGameHook_CSGameRules_DeathNotice *chain, CBasePl chain->callNext(getPrivate(_pVictim), PEV(_pKiller), PEV(_pevInflictor)); }; - callVoidForward(RG_CSGameRules_DeathNotice, original, indexOfEdict(pVictim->pev), indexOfEdict(pKiller), indexOfEdict(pevInflictor)); + callVoidForward(RG_CSGameRules_DeathNotice, original, indexOfEdict(pVictim->pev), indexOfEdict(pKiller), pevInflictor ? indexOfEdict(pevInflictor) : -1); } int CSGameRules_CanHavePlayerItem(IReGameHook_CSGameRules_CanHavePlayerItem *chain, CBasePlayer *pPlayer, CBasePlayerItem *pItem)