Skip to content

Commit

Permalink
Fix sound kick from body disentegration effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternalcodes committed Dec 4, 2017
1 parent 52c5a49 commit e9b415d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions codemp/cgame/cg_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,9 +1592,12 @@ Ghoul2 Insert End
{
if (lightSide)
{
if (curTimeDif < 2200)
{ //probably temporary
trap->S_StartSound ( NULL, cent->currentState.number, CHAN_AUTO, trap->S_RegisterSound( "sound/weapons/saber/saberhum1.wav" ) );
if (curTimeDif < 2200
&& cg.frametime > 0
&& ((cg.frametime < 50 && cg.time % 50 <= cg.frametime)
|| cg.frametime >= 50)) //probably temporary
{
trap->S_StartSound(NULL, cent->currentState.number, CHAN_AUTO, trap->S_RegisterSound("sound/weapons/saber/saberhum1.wav"));
}
}
else
Expand All @@ -1611,7 +1614,10 @@ Ghoul2 Insert End
{
ent.customShader = cgs.media.electricBody2Shader;
}
if ( Q_flrand(0.0f, 1.0f) > 0.9f )
if ((Q_flrand(0.0f, 1.0f) > 0.9f)
&& cg.frametime > 0
&& ((cg.frametime < 50 && cg.time % 50 <= cg.frametime)
|| cg.frametime >= 50))
{
trap->S_StartSound ( NULL, cent->currentState.number, CHAN_AUTO, cgs.media.crackleSound );
}
Expand Down

0 comments on commit e9b415d

Please sign in to comment.