]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
added network protocol for sound speed
[xonotic/darkplaces.git] / cl_parse.c
index ca4bec30cd8fdf8b30f2fcb145be4395ca292ca8..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,10 +247,15 @@ 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 ();
-                       channel = MSG_ReadByte ();
+                       channel = MSG_ReadChar ();
                }
                else
                {
@@ -262,6 +270,8 @@ void CL_ParseStartSoundPacket(int largesoundindex)
                        sound_num = MSG_ReadByte ();
        }
 
+       channel = CHAN_NET2ENGINE(channel);
+
        MSG_ReadVector(pos, cls.protocol);
 
        if (sound_num >= MAX_SOUNDS)