Prevent infinite loop

This commit is contained in:
mittorn 2017-02-02 21:15:29 +00:00
parent 9d7c772f33
commit 5deec79132

View File

@ -260,6 +260,13 @@ void CBaseMonster::Listen( void )
m_iAudibleList = iSound; m_iAudibleList = iSound;
} }
else if( iSound == pCurrentSound->m_iNext )
{
m_iAudibleList = SOUNDLIST_EMPTY;
ALERT( at_error, "Sound list is broken, preventing infinite loop!\n" );
return;
}
//iSound = g_pSoundEnt->m_SoundPool[iSound].m_iNext; //iSound = g_pSoundEnt->m_SoundPool[iSound].m_iNext;
iSound = pCurrentSound->m_iNext; iSound = pCurrentSound->m_iNext;