mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-08 21:14:14 +00:00
Prevent soundent loop
This commit is contained in:
parent
29bd5d059f
commit
45e13383ff
@ -219,6 +219,8 @@ void CBaseMonster::Listen( void )
|
|||||||
ClearConditions( bits_COND_HEAR_SOUND | bits_COND_SMELL_FOOD | bits_COND_SMELL );
|
ClearConditions( bits_COND_HEAR_SOUND | bits_COND_SMELL_FOOD | bits_COND_SMELL );
|
||||||
hearingSensitivity = HearingSensitivity();
|
hearingSensitivity = HearingSensitivity();
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
while( iSound != SOUNDLIST_EMPTY )
|
while( iSound != SOUNDLIST_EMPTY )
|
||||||
{
|
{
|
||||||
pCurrentSound = CSoundEnt::SoundPointerForIndex( iSound );
|
pCurrentSound = CSoundEnt::SoundPointerForIndex( iSound );
|
||||||
@ -260,14 +262,16 @@ void CBaseMonster::Listen( void )
|
|||||||
|
|
||||||
m_iAudibleList = iSound;
|
m_iAudibleList = iSound;
|
||||||
}
|
}
|
||||||
else if( iSound == pCurrentSound->m_iNext )
|
else if( i > 9999 || iSound == pCurrentSound->m_iNext )
|
||||||
{
|
{
|
||||||
|
void GGM_CleanSoundEnt( void );
|
||||||
m_iAudibleList = SOUNDLIST_EMPTY;
|
m_iAudibleList = SOUNDLIST_EMPTY;
|
||||||
|
pCurrentSound->m_iNext = -1;
|
||||||
ALERT( at_error, "Sound list is broken, preventing infinite loop!\n" );
|
ALERT( at_error, "Sound list is broken, preventing infinite loop!\n" );
|
||||||
|
GGM_CleanSoundEnt();
|
||||||
return;
|
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;
|
||||||
}
|
}
|
||||||
|
@ -376,3 +376,12 @@ int CSoundEnt::ClientSoundIndex( edict_t *pClient )
|
|||||||
|
|
||||||
return iReturn;
|
return iReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GGM_CleanSoundEnt( void )
|
||||||
|
{
|
||||||
|
if( !pSoundEnt )
|
||||||
|
return;
|
||||||
|
pSoundEnt->pev->flags |= FL_KILLME;
|
||||||
|
pSoundEnt = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user