From 689316912ac98dbd928caacaf73436130e391a28 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Wed, 5 Jul 2017 17:06:23 +0500 Subject: [PATCH] Merge https://github.com/SamVanheer/HLEnhanced/commit/19396936af13e417e7f9eaf48c48c49699da03fb --- cl_dll/ev_hldm.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 787e1be8..381c9179 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1430,6 +1430,12 @@ void EV_EgonFire( event_args_t *args ) } else { + // If there is any sound playing already, kill it. - Solokiller + // This is necessary because multiple sounds can play on the same channel at the same time. + // In some cases, more than 1 run sound plays when the egon stops firing, in which case only the earliest entry in the list is stopped. + // This ensures no more than 1 of those is ever active at the same time. + gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_STATIC, EGON_SOUND_RUN ); + if( iFireMode == FIRE_WIDE ) gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, EGON_SOUND_RUN, 0.98, ATTN_NORM, 0, 125 ); else @@ -1438,7 +1444,7 @@ void EV_EgonFire( event_args_t *args ) //Only play the weapon anims if I shot it. if( EV_IsLocal( idx ) ) - gEngfuncs.pEventAPI->EV_WeaponAnimation ( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 1 ); if( iStartup == 1 && EV_IsLocal( idx ) && !pBeam && !pBeam2 && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction. {