From d6fa5c74ba80688a3e14d2e099bfb6077323d079 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 4 Apr 2015 19:19:17 +0200 Subject: Initial implementation of hit sounds. --- src/cgame/cg_draw.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cgame/cg_draw.c') diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 8007bfe..2c9c400 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -3879,6 +3879,20 @@ found_blob: blob->flags = flags; VectorCopy( origin, blob->origin ); VectorSet( blob->velocity, crandom( ) * 20, crandom( ) * 20, 100 ); + + if( cg_hitSounds.integer > 1 || + ( cg_hitSounds.integer == 1 && + ( flags & DAMAGE_BLOB_FRIENDLY ) ) ) + { + int index; + + if( flags & DAMAGE_BLOB_FRIENDLY ) + index = 4; + else + index = ( flags & ( DAMAGE_BLOB_SPLASH | DAMAGE_BLOB_BUILDABLE ) ); + + trap_S_StartLocalSound( cgs.media.hitSounds[ index ], CHAN_LOCAL_SOUND ); + } } static void CG_DrawNumber( float x, float y, float h, char *str ) -- cgit