]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
made palette colors more readable
[xonotic/darkplaces.git] / cl_parse.c
index fcd88f7d80a086df4e6f4a88a8e007860aef4078..75f1e2b9654daa2d8f62f0aac48bbc3d988a2c72 100644 (file)
@@ -164,6 +164,9 @@ 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)"};
+
+#define RIC_GUNSHOT            1
+#define RIC_GUNSHOTQUAD        2
 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"};
@@ -2087,7 +2090,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 == 1 || cl_sound_ric_gunshot.integer == 3)
+                       if(cl_sound_ric_gunshot.integer & RIC_GUNSHOT)
                        {
                                if (rand() % 5)
                                        S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
@@ -2293,7 +2296,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 == 1 || cl_sound_ric_gunshot.integer == 3)
+                       if(cl_sound_ric_gunshot.integer & RIC_GUNSHOT)
                        {
                                if (rand() % 5)
                                        S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
@@ -2315,7 +2318,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 >= 2)
+                       if(cl_sound_ric_gunshot.integer & RIC_GUNSHOTQUAD)
                        {
                                if (rand() % 5)
                                        S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
@@ -2819,7 +2822,7 @@ static void CL_NetworkTimeReceived(double newtime)
        double timehigh;
        cl.mtime[1] = max(cl.mtime[0], newtime - 0.1);
        cl.mtime[0] = newtime;
-       if (cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer) || cl.mtime[0] == newtime || cls.signon < SIGNONS)
+       if (cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer) || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
                cl.time = cl.mtime[1] = newtime;
        else if (cls.protocol != PROTOCOL_QUAKEWORLD)
        {