]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added cl_gameplayfix_soundsmovewithentities cvar so that this feature
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Aug 2007 06:31:08 +0000 (06:31 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Aug 2007 06:31:08 +0000 (06:31 +0000)
can be disabled if desired

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7522 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
snd_main.c

index dc4e748dc92b566fb571b0705fc687a3324401a7..83322bd3cc193580c0558e2f885f5509be19df12 100644 (file)
@@ -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);
index 4078e7371014434583e43d9fd78a8c64a0c8dbe9..ab69816b8a941b3511b6767ef7e4027f60771969 100644 (file)
@@ -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)
                {