From b7bc2770bea6257e4a0c9b8e7c7cd8c08b2182c4 Mon Sep 17 00:00:00 2001 From: s1lent Date: Thu, 4 May 2017 21:03:52 +0700 Subject: [PATCH] Fix crash when a func_tank owner dies. (reversing engineering mistake) --- regamedll/dlls/func_tank.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/func_tank.cpp b/regamedll/dlls/func_tank.cpp index 22557bd5..7197a81e 100644 --- a/regamedll/dlls/func_tank.cpp +++ b/regamedll/dlls/func_tank.cpp @@ -306,7 +306,7 @@ void CFuncTank::ControllerPostFrame() if (gpGlobals->time < m_flNextAttack) return; - if (m_pController != NULL && m_pController->pev->button & IN_ATTACK) + if (m_pController->pev->button & IN_ATTACK) { Vector vecForward; UTIL_MakeVectorsPrivate(pev->angles, vecForward, NULL, NULL); @@ -314,7 +314,7 @@ void CFuncTank::ControllerPostFrame() m_fireLast = gpGlobals->time - (1.0f / m_fireRate) - 0.01f; Fire(BarrelPosition(), vecForward, m_pController->pev); - if (m_pController->IsPlayer()) + if (m_pController && m_pController->IsPlayer()) { m_pController->m_iWeaponVolume = LOUD_GUN_VOLUME; }