Skip to content

Commit 4194540

Browse files
authored
Fixed a crash when npc_helicopter that is awaiting input is killed (#419)
1 parent 93efcbb commit 4194540

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sp/src/game/server/hl2/npc_attackchopper.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,9 +4055,12 @@ void CNPC_AttackHelicopter::Event_Killed( const CTakeDamageInfo &info )
40554055
}
40564056

40574057
m_lifeState = LIFE_DYING;
4058-
4059-
CSoundEnvelopeController &controller = CSoundEnvelopeController::GetController();
4060-
controller.SoundChangeVolume( m_pGunFiringSound, 0.0, 0.1f );
4058+
4059+
if ( GetSleepState() != AISS_WAITING_FOR_INPUT )
4060+
{
4061+
CSoundEnvelopeController& controller = CSoundEnvelopeController::GetController();
4062+
controller.SoundChangeVolume( m_pGunFiringSound, 0.0, 0.1f );
4063+
}
40614064

40624065
if( GetCrashPoint() == NULL )
40634066
{

0 commit comments

Comments
 (0)