From 72f038ae632b0f9af485129747f5fca45898b52e Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 4 Apr 2015 11:44:44 +0200 Subject: Fix the vote start sound being played every frame for a second. --- src/cgame/cg_draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index fafddb6..f57e44a 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -3610,17 +3610,17 @@ static void CG_DrawVote( team_t team ) int offset = 0; vec4_t white = { 1.0f, 1.0f, 1.0f, 1.0f }; char yeskey[ 32 ] = "", nokey[ 32 ] = ""; + static int lastVoteTime[ NUM_TEAMS ] = { 0 }; - if( !cgs.voteTime[ team ] ) return; - + sec = ( VOTE_TIME - ( cg.time - cgs.voteTime[ team ] ) ) / 1000; - //play dong sound - if(sec > 28 ) + if( cgs.voteTime[ team ] != lastVoteTime[ team ] ) { trap_S_StartLocalSound( cgs.media.iniVote, CHAN_LOCAL_SOUND ); + lastVoteTime[ team ] = cgs.voteTime[ team ]; } // if( cgs.voteModified[ team ] && (sec < 26 ) ) -- cgit