From c90433004137c814f55488a9d4484f8d672c2a3f Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 12 Aug 2007 06:31:08 +0000 Subject: [PATCH] added cl_gameplayfix_soundsmovewithentities cvar so that this feature can be disabled if desired git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7522 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 2 ++ snd_main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cl_parse.c b/cl_parse.c index dc4e748d..83322bd3 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -158,6 +158,7 @@ char *qw_svc_strings[128] = cvar_t demo_nehahra = {0, "demo_nehahra", "0", "reads all quake demos as nehahra movie protocol"}; cvar_t developer_networkentities = {0, "developer_networkentities", "0", "prints received entities, value is 0-4 (higher for more info)"}; +cvar_t cl_gameplayfix_soundsmovewithentities = {0, "cl_gameplayfix_soundsmovewithentities", "1", "causes sounds made by lifts, players, projectiles, and any other entities, to move with the entity, so for example a rocket noise follows the rocket rather than staying at the starting position"}; cvar_t cl_sound_wizardhit = {0, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"}; cvar_t cl_sound_hknighthit = {0, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"}; cvar_t cl_sound_tink1 = {0, "cl_sound_tink1", "weapons/tink1.wav", "sound to play with 80% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}; @@ -3821,6 +3822,7 @@ void CL_Parse_Init(void) if (gamemode == GAME_NEHAHRA) Cvar_SetValue("demo_nehahra", 1); Cvar_RegisterVariable(&developer_networkentities); + Cvar_RegisterVariable(&cl_gameplayfix_soundsmovewithentities); Cvar_RegisterVariable(&cl_sound_wizardhit); Cvar_RegisterVariable(&cl_sound_hknighthit); diff --git a/snd_main.c b/snd_main.c index 4078e737..ab69816b 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1100,6 +1100,7 @@ SND_Spatialize Spatializes a channel ================= */ +extern cvar_t cl_gameplayfix_soundsmovewithentities; void SND_Spatialize(channel_t *ch, qboolean isstatic) { int i; @@ -1107,7 +1108,7 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic) vec3_t source_vec; // update sound origin if we know about the entity - if (ch->entnum > 0 && cls.state == ca_connected) + if (ch->entnum > 0 && cls.state == ca_connected && cl_gameplayfix_soundsmovewithentities.integer) { if (ch->entnum >= 32768) { -- 2.39.2