From 0fed5b8038408c54a93cefbe7fda0c7f1b63953c Mon Sep 17 00:00:00 2001 From: Artem Golubikhin Date: Sat, 19 Jun 2021 13:12:24 +0300 Subject: [PATCH] Fixed volume checking in emit sound (#341) Co-authored-by: Dmitry Novikov Co-authored-by: Sergey Shorokhov --- rehlds/engine/pr_cmds.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index c56eaec..6b949ad 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -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);