2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-27 23:25:45 +03:00

SV_BuildSoundMsg: fix '\n' in args check

- fix #965
This commit is contained in:
Sergey Shorokhov 2023-05-08 12:24:16 +03:00
parent 1796459953
commit a680f18ee1

View File

@ -680,22 +680,22 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
if (volume < 0 || volume > 255) if (volume < 0 || volume > 255)
{ {
Con_Printf("%s: volume = %i", __func__, volume); Con_Printf("%s: volume = %i\n", __func__, volume);
volume = (volume < 0) ? 0 : 255; volume = (volume < 0) ? 0 : 255;
} }
if (attenuation < 0.0f || attenuation > 4.0f) if (attenuation < 0.0f || attenuation > 4.0f)
{ {
Con_Printf("%s: attenuation = %f", __func__, attenuation); Con_Printf("%s: attenuation = %f\n", __func__, attenuation);
attenuation = (attenuation < 0.0f) ? 0.0f : 4.0f; attenuation = (attenuation < 0.0f) ? 0.0f : 4.0f;
} }
if (channel < 0 || channel > 7) if (channel < 0 || channel > 7)
{ {
Con_Printf("%s: channel = %i", __func__, channel); Con_Printf("%s: channel = %i\n", __func__, channel);
channel = (channel < 0) ? CHAN_AUTO : CHAN_NETWORKVOICE_BASE; channel = (channel < 0) ? CHAN_AUTO : CHAN_NETWORKVOICE_BASE;
} }
if (pitch < 0 || pitch > 255) if (pitch < 0 || pitch > 255)
{ {
Con_Printf("%s: pitch = %i", __func__, pitch); Con_Printf("%s: pitch = %i\n", __func__, pitch);
pitch = (pitch < 0) ? 0 : 255; pitch = (pitch < 0) ? 0 : 255;
} }
@ -707,7 +707,7 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
sound_num = Q_atoi(sample + 1); sound_num = Q_atoi(sample + 1);
if (sound_num >= CVOXFILESENTENCEMAX) if (sound_num >= CVOXFILESENTENCEMAX)
{ {
Con_Printf("%s: invalid sentence number: %s", __func__, sample + 1); Con_Printf("%s: invalid sentence number: %s\n", __func__, sample + 1);
return FALSE; return FALSE;
} }
} }