From ce84da3c50b2397b0fcae46dcd8b6c26566cb95b Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 23 Feb 2019 15:56:04 +0000 Subject: [PATCH] schedule: nullptr check --- dlls/schedule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/schedule.cpp b/dlls/schedule.cpp index 4a5cefca..1db7dcb7 100644 --- a/dlls/schedule.cpp +++ b/dlls/schedule.cpp @@ -875,7 +875,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) } case TASK_MOVE_TO_TARGET_RANGE: { - if( ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1 ) + if( !m_hTargetEnt || ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1 ) TaskComplete(); else { @@ -890,7 +890,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) { Activity newActivity; - if( ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1 ) + if( !m_hTargetEnt || ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1 ) TaskComplete(); else {