Browse Source

schedule: nullptr check

gravgun
mittorn 6 years ago
parent
commit
ce84da3c50
  1. 4
      dlls/schedule.cpp

4
dlls/schedule.cpp

@ -875,7 +875,7 @@ void CBaseMonster::StartTask( Task_t *pTask ) @@ -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 ) @@ -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
{

Loading…
Cancel
Save