diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 879cb68dc..91cc7c368 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -3464,9 +3464,9 @@ void CLNQ_ParseStartSoundPacket(void) attenuation = DEFAULT_SOUND_PACKET_ATTENUATION; if (field_mask & FTESND_PITCHADJ) - pitchadj = MSG_ReadChar(); + pitchadj = MSG_ReadByte(); else - pitchadj = 0; + pitchadj = 100; if (field_mask & DPSND_LARGEENTITY) { diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index 807adc53f..0a28b3cf8 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -880,6 +880,8 @@ void S_StartSoundCard(soundcardinfo_t *sc, int entnum, int entchannel, sfx_t *sf #endif vol = fvol*255; + if (!pitchadj) + pitchadj = 100; // pick a channel to play on target_chan = SND_PickChannel(sc, entnum, entchannel); @@ -919,7 +921,7 @@ void S_StartSoundCard(soundcardinfo_t *sc, int entnum, int entchannel, sfx_t *sf startpos = scache->length - snd_speed*10; } target_chan->sfx = sfx; - target_chan->rate = (1<rate = ((1<pos = startpos*target_chan->rate; target_chan->end = sc->paintedtime + ((scache->length - startpos)<rate; target_chan->looping = false; diff --git a/engine/common/protocol.h b/engine/common/protocol.h index 9ba28c00f..7182c20e4 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -603,7 +603,7 @@ enum clcq2_ops_e #define DPSND_LOOPING (1<<2) // a long, supposedly #define DPSND_LARGEENTITY (1<<3) #define DPSND_LARGESOUND (1<<4) -#define FTESND_PITCHADJ (1<<7) //a char (final rate is (1<<8)+pitch as 24.8 fixed point) +#define FTESND_PITCHADJ (1<<7) //a byte (speed percent (0=100%)) #define DEFAULT_SOUND_PACKET_VOLUME 255 #define DEFAULT_SOUND_PACKET_ATTENUATION 1.0 diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 4afb6843f..b322ce921 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -857,7 +857,7 @@ void SV_StartSound (int ent, vec3_t origin, int seenmask, int channel, char *sam extfield_mask |= DPSND_LARGEENTITY; if (sound_num > 0xff) extfield_mask |= DPSND_LARGESOUND; - if (pitchadj) + if (pitchadj && (pitchadj != 100)) extfield_mask |= FTESND_PITCHADJ; #ifdef PEXT_SOUNDDBL @@ -871,7 +871,7 @@ void SV_StartSound (int ent, vec3_t origin, int seenmask, int channel, char *sam if (extfield_mask & NQSND_ATTENUATION) MSG_WriteByte (&sv.multicast, attenuation*64); if (extfield_mask & FTESND_PITCHADJ) - MSG_WriteChar (&sv.multicast, pitchadj); + MSG_WriteByte (&sv.multicast, pitchadj); if (extfield_mask & DPSND_LARGEENTITY) { MSG_WriteShort (&sv.multicast, ent); @@ -926,7 +926,7 @@ void SV_StartSound (int ent, vec3_t origin, int seenmask, int channel, char *sam if (extfield_mask & NQSND_ATTENUATION) MSG_WriteByte (&sv.nqmulticast, attenuation*64); if (extfield_mask & FTESND_PITCHADJ) - MSG_WriteChar (&sv.nqmulticast, pitchadj); + MSG_WriteByte (&sv.nqmulticast, pitchadj); if (extfield_mask & DPSND_LARGEENTITY) { MSG_WriteShort (&sv.nqmulticast, ent);