From 2198176a13573b28800e7a99aebb4c879fb83376 Mon Sep 17 00:00:00 2001 From: IgnacioDM Date: Wed, 6 Jan 2016 06:09:50 -0300 Subject: [PATCH] Fix player.cpp crash when m_pActiveItem = null --- regamedll/dlls/player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index c030d08a..0fa1266b 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1330,10 +1330,11 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe if (pAttack->m_iTeam == m_iTeam && bAttackFFA) flDamage *= 0.35; - iGunType = pAttack->m_pActiveItem->m_iId; if (pAttack->m_pActiveItem) { + iGunType = pAttack->m_pActiveItem->m_iId; + flRatio += flShieldRatio; switch (iGunType) {