]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
added network protocol for sound speed
[xonotic/darkplaces.git] / cl_parse.c
index 3d56d11199524f718b880249a9707b05a3952524..18f00dcfe48f8b3285ea5420ecfa97ae53dbf04f 100644 (file)
@@ -210,6 +210,7 @@ void CL_ParseStartSoundPacket(int largesoundindex)
        int     volume;
        int     field_mask;
        float   attenuation;
+       float   speed;
 
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
        {
@@ -224,6 +225,8 @@ void CL_ParseStartSoundPacket(int largesoundindex)
                        attenuation = MSG_ReadByte () / 64.0;
                else
                        attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;
+       
+               speed = 1.0f;
 
                ent = (channel>>3)&1023;
                channel &= 7;
@@ -244,6 +247,11 @@ void CL_ParseStartSoundPacket(int largesoundindex)
                else
                        attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;
 
+               if (field_mask & SND_SPEEDUSHORT4000)
+                       speed = ((unsigned short)MSG_ReadShort ()) / 4000.0f;
+               else
+                       speed = 1.0f;
+
                if (field_mask & SND_LARGEENTITY)
                {
                        ent = (unsigned short) MSG_ReadShort ();