From 945f57de5bd5a1d46266f09c5d99a7efde831f63 Mon Sep 17 00:00:00 2001 From: dresk Date: Mon, 30 Apr 2007 03:58:20 +0000 Subject: [PATCH] Updated cl_sound_ric_gunshot CVar to support multiple modes. 0 plays no sounds, 1 plays sounds on TE_GUNSHOT, 2 plays sounds on TE_GUNSHOTQUAD and 3 plays sounds on both TE_GUNSHOT and TE_GUNSHOTQUAD. This is not bloat because the Crylink in Nexuiz uses TE_GUNSHOTQUAD, and most people don't want ricochet sounds on that (though if you do, all the merrier). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7209 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 8 ++++---- clvm_cmds.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index b08170fa..ba4972dc 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -164,7 +164,7 @@ cvar_t cl_sound_tink1 = {0, "cl_sound_tink1", "weapons/tink1.wav", "sound to pla cvar_t cl_sound_ric1 = {0, "cl_sound_ric1", "weapons/ric1.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}; cvar_t cl_sound_ric2 = {0, "cl_sound_ric2", "weapons/ric2.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}; cvar_t cl_sound_ric3 = {0, "cl_sound_ric3", "weapons/ric3.wav", "sound to play with 10% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}; -cvar_t cl_sound_ric_gunshot = {0, "cl_sound_ric_gunshot", "0", "specifies if the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD"}; +cvar_t cl_sound_ric_gunshot = {0, "cl_sound_ric_gunshot", "0", "specifies if and when the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD, 0 = no sound, 1 = TE_GUNSHOT, 2 = TE_GUNSHOTQUAD, 3 = TE_GUNSHOT and TE_GUNSHOTQUAD"}; cvar_t cl_sound_r_exp3 = {0, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"}; cvar_t cl_serverextension_download = {0, "cl_serverextension_download", "0", "indicates whether the server supports the download command"}; cvar_t cl_joinbeforedownloadsfinish = {CVAR_SAVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"}; @@ -2087,7 +2087,7 @@ void CL_ParseTempEntity(void) VectorSet(pos2, pos[0] + radius, pos[1] + radius, pos[2] + radius); VectorSet(pos, pos[0] - radius, pos[1] - radius, pos[2] - radius); CL_ParticleEffect(EFFECT_TE_GUNSHOT, radius, pos, pos2, vec3_origin, vec3_origin, NULL, 0); - if(cl_sound_ric_gunshot.integer) + if(cl_sound_ric_gunshot.integer == 1 || cl_sound_ric_gunshot.integer == 3) { if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1); @@ -2293,7 +2293,7 @@ void CL_ParseTempEntity(void) MSG_ReadVector(pos, cls.protocol); CL_FindNonSolidLocation(pos, pos, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOT, 1, pos, pos, vec3_origin, vec3_origin, NULL, 0); - if(cl_sound_ric_gunshot.integer) + if(cl_sound_ric_gunshot.integer == 1 || cl_sound_ric_gunshot.integer == 3) { if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1); @@ -2315,7 +2315,7 @@ void CL_ParseTempEntity(void) MSG_ReadVector(pos, cls.protocol); CL_FindNonSolidLocation(pos, pos, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOTQUAD, 1, pos, pos, vec3_origin, vec3_origin, NULL, 0); - if(cl_sound_ric_gunshot.integer) + if(cl_sound_ric_gunshot.integer >= 2) { if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1); diff --git a/clvm_cmds.c b/clvm_cmds.c index f7849812..81320714 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1343,7 +1343,7 @@ static void VM_CL_te_gunshotquad (void) pos = PRVM_G_VECTOR(OFS_PARM0); CL_FindNonSolidLocation(pos, pos2, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOTQUAD, 1, pos2, pos2, vec3_origin, vec3_origin, NULL, 0); - if(cl_sound_ric_gunshot.integer) + if(cl_sound_ric_gunshot.integer >= 2) { if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1); else @@ -1448,7 +1448,7 @@ static void VM_CL_te_gunshot (void) pos = PRVM_G_VECTOR(OFS_PARM0); CL_FindNonSolidLocation(pos, pos2, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOT, 1, pos2, pos2, vec3_origin, vec3_origin, NULL, 0); - if(cl_sound_ric_gunshot.integer) + if(cl_sound_ric_gunshot.integer == 1 || cl_sound_ric_gunshot.integer == 3) { if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1); else -- 2.39.2