attenuation = MSG_ReadByte(&cl_message) / 64.0;
else
attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;
-
+
speed = 1.0f;
ent = (channel>>3)&1023;
MSG_ReadVector(&cl_message, pos, cls.protocol);
- if (sound_num >= MAX_SOUNDS)
+ if (sound_num < 0 || sound_num >= MAX_SOUNDS)
{
Con_Printf("CL_ParseStartSoundPacket: sound_num (%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
return;
// clear name of file that just finished
cls.qw_downloadname[0] = 0;
+ // skip the download fragment if playing a demo
+ if (!cls.netcon)
+ {
+ return;
+ }
+
switch (cls.qw_downloadtype)
{
case dl_single:
{
for (j = 0;j < 6;j++)
bits[j] = MSG_ReadByte(&cl_message);
- if (cl.qw_num_nails > 255)
+ if (cl.qw_num_nails >= 255)
continue;
v = cl.qw_nails[cl.qw_num_nails++];
v[0] = ( ( bits[0] + ((bits[1]&15)<<8) ) <<1) - 4096;
sound_num = (unsigned short) MSG_ReadShort(&cl_message);
else
sound_num = MSG_ReadByte(&cl_message);
+
+ if (sound_num < 0 || sound_num >= MAX_SOUNDS)
+ {
+ Con_Printf("CL_ParseStaticSound: sound_num(%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
+ return;
+ }
+
vol = MSG_ReadByte(&cl_message);
atten = MSG_ReadByte(&cl_message);
CL_FindNonSolidLocation(pos, pos, 10);
colorStart = MSG_ReadByte(&cl_message);
colorLength = MSG_ReadByte(&cl_message);
+ if (colorLength == 0)
+ colorLength = 1;
CL_ParticleExplosion2(pos, colorStart, colorLength);
tempcolor = palette_rgb[(rand()%colorLength) + colorStart];
color[0] = tempcolor[0] * (2.0f / 255.0f);