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

Fixed volume checking in emit sound (#341)

Co-authored-by: Dmitry Novikov <s1lentsk@yandex.ru>
Co-authored-by: Sergey Shorokhov <wopox1337@ya.ru>
This commit is contained in:
Artem Golubikhin 2021-06-19 13:12:24 +03:00 committed by GitHub
parent 3a9bfb9ca1
commit 0fed5b8038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,7 +312,11 @@ void EXT_FUNC PF_ambientsound_I(edict_t *entity, float *pos, const char *samp, f
void EXT_FUNC PF_sound_I(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch)
{
#ifdef REHLDS_FIXES
if (volume < 0.0f || volume > 1.0f)
#else
if (volume < 0.0 || volume > 255.0)
#endif
Sys_Error("%s: volume = %i", __func__, volume);
if (attenuation < 0.0 || attenuation > 4.0)
Sys_Error("%s: attenuation = %f", __func__, attenuation);