Fixed a crash when npc_helicopter that is awaiting input is killed (#419)

This commit is contained in:
Wikot235 2025-05-25 18:08:41 +02:00 committed by GitHub
parent 93efcbbcfd
commit 41945409d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4055,9 +4055,12 @@ void CNPC_AttackHelicopter::Event_Killed( const CTakeDamageInfo &info )
}
m_lifeState = LIFE_DYING;
CSoundEnvelopeController &controller = CSoundEnvelopeController::GetController();
controller.SoundChangeVolume( m_pGunFiringSound, 0.0, 0.1f );
if ( GetSleepState() != AISS_WAITING_FOR_INPUT )
{
CSoundEnvelopeController& controller = CSoundEnvelopeController::GetController();
controller.SoundChangeVolume( m_pGunFiringSound, 0.0, 0.1f );
}
if( GetCrashPoint() == NULL )
{